Is there any reason Plex would not honor the header for internal addresses? There is a similar issue for IPV6 not being honored which is a plex issue…
V6 isn’t supported by PMS for anything external (yet).
I remember seeing something about using a 301 rewrite (?) when using a proxy. I don’t know what that means but I’ve seen it makes a difference between success and failure.
Also, PMS does not like its cert usurped so be advised of that when using your cert.
My config for the proxy is doing exactly the right thing to get the request to plex. With a non private IP, it does:
Aug 31, 2018 13:47:14.290 [0x7f1bec7ff700] VERBOSE - X-Forwarded-For: 73.81.0.XX
Aug 31, 2018 13:47:14.290 [0x7f1bec7ff700] DEBUG - Using X-Forwarded-For: 73.81.0.XX as remote address
but when it’s a private IP, it doesn’t create the 2nd line, which leads me to Plex not liking the private addresses. I can play / stream everything fine from every location, but since it doesn’t pass it, it thinks it is coming from 127.0.0.1 , which shows up as the WAN.
The source ip on the packet isn’t being used as that would be the proxy sending the traffic. The
X-Forwarded-For part of the HTTP traffic is what Plex is interpreting and replacing that with the IP.
Similar with proxying via Cloudflare:
I’m just baffled as to why the internal addresses are being ignored while external are as it’s in Plex since the packet captures and all the plex debug logs show the proper header.
In the cloudflare example, it’s just saying if you see a real ip that’s one of those, replace the real ip with the source IP from cloudflare that is passes over.
It’s the specific code in Plex that’s here:
14.290 [0x7f1bec7ff700] DEBUG - Using X-Forwarded-For: 73.81.0.XX as remote address
I changed the VPN NAT a few times to all the private ranges and they are not respected by Plex as the X-Forward-For.
The ones that do not work are the RFC private ranges 192.168.1/192.168.2/10.0.8.0 are the /24 I tested so I’d surmise it’s all the RFC subnets that Plex drops as an X-Forward-For.
I am having the same issue. And I can confirm this is not a config issue but a PMS issue. Any private address that gets sent as X-Forwarded-For is ignored.
I’m also having the issue with my setup. I have plex hosted on a cloud VPS at scaleway. At my home I have a direct VPN connect to that VPS. When I’m at home / or connected to the VPN, traffic directed to my domain name is transparently routed towards the VPN tunnel. I also have traefik as a reversed proxy doing all the nice things with Let’s encrypt.
The following trick with the CGNat prefix works well, now I’m correctly seeing that it is correctly setting remote-addr from X-Forwarded-For header: Nov 28, 2018 21:14:27.876 [0x7f5278bff700] DEBUG - Using X-Forwarded-For: 100.64.8.1 as remote address
But once you want to setup the list of IP addresses and networks that are allowed without auth. Basically accessing plex from within the LAN should not require authentication, things breaks. Because it wrongly evaluation 100.64.0.0/10 as a public routable address, which is not the case: https://en.wikipedia.org/wiki/Reserved_IP_addresses:
From the logs: Nov 28, 2018 21:14:27.876 [0x7f5278bff700] ERROR - Illegal whitelist covers multiple WAN IPs