• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Issue Plesk Panel X-Forwarded-For

Chris Lemmer

New Pleskian
Hi there,

In front of my Plesk server, I have an apache reverse proxy. So I've had to modify the config files of my vhosts to log the correct X-Forwarded-For IP. I this this by modifying the following file as follows:

File: /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"[XF %{X-Forwarded-For}i]" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog "<?php echo $VAR->domain->physicalHosting->logsDir ?>/<?php echo $OPT['ssl'] ? 'access_ssl_log' : 'access_log' ?>" combined env=!forwarded
CustomLog "<?php echo $VAR->domain->physicalHosting->logsDir ?>/<?php echo $OPT['ssl'] ? 'access_ssl_log' : 'access_log' ?>" proxy env=forwarded

Now, this works very nicely and each vhost generated by this file , logs correctly. However, I'm still struggling to get the actual Plesk panel to log correctly as well. When I tail the actual Plesk log, it still looks like this:

tail -f /usr/local/psa/admin/logs/httpsd_access_log

192.168.1.3 - - [02/Feb/2017:10:12:56 +0200] "GET /javascript/jsw.min.js?1485827310 HTTP/1.1" 304 0 "https://plesk-host01.mydomain.xx.xx...url=https://plesk-host01.mydomain.xx.xx:8443/" "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1" "41.13.86.76"'/javascript/jsw.min.js' '' '/usr/local/psa/admin/htdocs

In my case, 192.168.1.3 is the IP of my reverse proxy. So my question is, what config file should I modify in order to make it show the X-forwarded-For IP as above?

Thanks
Chris
 
Back
Top