• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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