Plex requires login when using domain name

I have my plex server on a server servername.home. However every time I try to open http://servername.home:32400/web/index.html I’m being redirected to app.plex.tv to log in, on every device (ios, android, windows, linux). The issue does not occur when I use IP in URL.

I have added both domains to "Custom server access URLs " and defined 0.0.0.0/0.0.0.0 in " List of IP addresses and networks that are allowed without auth "

I’ve tried configuring apache httpd as a workaround (both plex.home and servername.home/plex urls) but without success - plex still redirects me to app.plex.tv.

Apache config:

<VirtualHost *:80>
ServerName plex.home
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyRequests off
  ProxyPreserveHost on
  AllowEncodedSlashes NoDecode
  ProxyPass / http://127.0.0.1:32400/
  ProxyPassReverse / http://127.0.0.1:32400/
  RequestHeader set "Host" "127.0.0.1"
  RequestHeader set "Referer" "127.0.0.1"
  RequestHeader set "Origin" "http://127.0.0.1:80/plex"
  RequestHeader set "X-Real-IP" "127.0.0.1"
  RequestHeader set "X-Forwarded-For" "127.0.0.1"
</VirtualHost>

and

ProxyRequests Off

<Location /plex/>
  ProxyPass http://localhost:32400/
  ProxyPassReverse http://localhost:32400/
  ProxyHTMLEnable On
  ProxyHTMLExtended On
  ProxyHTMLURLMap / /plex/
  RequestHeader set "X-Real-IP" "127.0.0.1"
  RequestHeader set "X-Forwarded-For" "127.0.0.1"
  RequestHeader set "Host" "127.0.0.1"
  RequestHeader set "Referer" "127.0.0.1"
  RequestHeader set "Origin" "http://127.0.0.1:80/plex"
</Location>

any ideas why it’s broken?

Are you trying to make it wide open to the Internet, or to an internal private network?

I don’t think Plex will support you making it open to the Internet, if that’s the case.

I don’t believe Plex will allow 0.0.0.0/0 in the ... without auth setting. If you want all private addresses, you could try 127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 (no spaces, it’s picky).

Plex does use some of the “Proxied For” headers if they’re present. I think you got them - but maybe there’s something else, too. What do you see in Apache and Plex logs when you make a request?

I wonder if this might be relevant. Some old threads implying that Plex handles X-Forwarded-For/X-Real-IP differently for RFC1918 addresses vs. “public” addresses.

NGINX Proxy - X-Forwarded-For ignored for 192.168 / 10.0 / private addresses

Thanks for taking interest in my issue!

Just home LAN, 10.0.0.0/24

I don’t get this. Why plex treats some subnets in a different way than the others? And why it’s not documented anywhere?

I’ve tried various subnets in various format - no dice. Plex was consistently ignoring this setting and I could only access plex w/o auth from the very same machine.

However I’ve managed it to make it work by tricking plex that every request comes from its IP on this LAN:

  1. I’ve set “… without auth” to: 10.0.0.1/255.0.0.0
  2. configured apache reverse proxy to access plex through the IP on this subnet configured above:
<VirtualHost *:80>
  ServerName plex.home
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyRequests off
  ProxyPreserveHost on
  AllowEncodedSlashes NoDecode
  ProxyPass / http://10.0.0.2:32400/
  ProxyPassReverse / http://10.0.0.2:32400/
  RequestHeader set "Host" "10.0.0.2"
  RequestHeader set "Referer" "10.0.0.2"
  RequestHeader set "Origin" "http://10.0.0.2:80/"
  RequestHeader set "X-Real-IP" "10.0.0.2"
  RequestHeader set "X-Forwarded-For" "10.0.0.2"
</VirtualHost>

Glad it’s working!

It’s hinted at in the docs - they say “LAN addresses”. I agree that’s vague, and would be better if it said what wasn’t allowed too.

https://support.plex.tv/articles/200890058-authentication-for-local-network-access/

https://support.plex.tv/articles/200430283-network/

You can specify individual public IP addresses.
You can’t specify public subnets, and you can’t specify 0.0.0.0/0.
It’s to keep you from accidentally - or deliberately - opening your server to the Internet.

I don’t think you should have to overwrite the Real/Forwarded addresses in the Proxy like that, but I’m glad it’s working.

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