0

I've setup a subdomain for use with plesk so I don't have to type out the port all the time.

Here is my HTTP configuration:

SSLProxyEngine Off
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule $ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Here is my HTTPS configuration:

SSLProxyEngine On
AllowEncodedSlashes On

<Location />
    ProxyPass https://localhost:8443/
    ProxyPassReverse https://localhost:8443/
</Location>

Here is my nginx configuration (doesn't do anything I need, just tried it):

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;

It shows the IP as 127.0.0.1, how can I get my real IP to show up when behind ProxyPass?

2
  • That is the effect of using a proxy... As the X-forwarded-for Header has been set, your provide Plesk with the original IP-address but displaying that probably requires changes to your control panel, which may or may not be supported by the vendor.
    – HBruijn
    Feb 18, 2015 at 8:06
  • Last I checked, Plex wasn’t too proxy-happy. Other than that, HBruijn is right, of course: The (server) application has to support it.
    – Daniel B
    Feb 18, 2015 at 8:12

1 Answer 1

0

It appears you merely needed to modify a fastcgi parameter, and since plesk runs it's own instance it won't interfere with any other services.

Add the following line to /etc/sw-cp-server/fastcgi_params:

fastcgi_param REMOTE_ADDR $http_x_real_ip;

Or just run this command with appropriate privleges:

echo 'fastcgi_param REMOTE_ADDR $http_x_real_ip;' > /etc/sw-cp-server/fastcgi_params

Then restart the service:

/etc/init.d/sw-cp-server restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .