NGINX Reverse Proxy - X-Real-IP being ignored

Server Version#: 1.32.6.7557
Player Version#: Latest

Hey. I’ve recently set up to run through a reverse proxy hosted on a NGINX Proxy Manager Docker. I’ve got all the SSL and proxy host forwarding set up and have disabled Remote Access and published the url on my PMS. It all works fine apart from when I stream outside the LAN, it reports in as the reverse proxy address as it looks as though the real-ip header is being ignored. It looks fine inside the LAN, the stream reports the correct device IP, but any remote show as the reverse proxy IP.

My conf looks like:
location / {
proxy_pass https://local.server.address.plex.direct:32400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#When using ngx_http_realip_module change $proxy_add_x_forwarded_for to ‘$http_x_forwarded_for,$realip_remote_addr’
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
}

Has anyone successfully got this working and the real IP’s being respected? If so, I’d love to know how.

Many thanks.

Just to add to that I can see the X-Real-IP and X-Forwarded-For IPs in the log file show the remote IP address.

Same problem.
Use wireguard connect to home server with ip 10.111.0.x
However, the plex shows the nginx ip 192.168.1.x.
The log of plex show the corrent X-FORWARED-For (10.111.0.x)

1 Like

Does Plex take into account the X-Forwarded-For header?

1 Like

You probably need to reach out to NGINX resources for this one. This should not be a Plex issue, and you will find others who have fixed this type of issue with a broader net.

Same here, how to fix it?

1 Like

Same story here although I found a blog describing how to work around this, I can’t seem to see the real IP either :frowning:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.