• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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