Self Hosted "Plex is not reachable" when using nginx proxy

Server Version#: Plex Media Server v1.21.1.3876-3c3adfcb4 - Docker Docker Container x86_64 - build: linux-x86_64 debian - GMT -08:00
Player Version#: Chrome

Hi Everyone,

Yesterday I set up Plex media server in docker.

I can reach it via

http s:// --local-ip–:32400/web ( which is http s://192.168.99.50:32400)
and
http s:// --public-ip–:32400/web

and from plex.tv

That’s all well and good, but I also want to be able to reach it from

http s:// media.<HOST.COM>/web

So I have set up an nginx reverse proxy

server {

    # Setup HTTPS certificates
    listen       443 ssl;
    server_name media.HOSTNAME.com; # managed by Certbot


    location = /robots.txt {
    add_header  Content-Type  text/plain;
    return 200 "User-agent: *\nDisallow: /\n";
    }
    ssl_certificate /etc/letsencrypt/live/media.HOSTNAME.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/media.HOSTNAME.com/privkey.pem; # managed by Certbot

    # Proxy to the Airsonic server
    location / {
        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;
        proxy_set_header X-Forwarded-Host  $http_host;
        proxy_set_header Host              $http_host;
        proxy_max_temp_file_size           0;
        proxy_pass                         https://192.168.99.50:32400;
        proxy_redirect                     http:// https ://;
    }
}


When I go to media.HOSTNAME.com I DO get to the plex server, but it says:

"Plex is not reachable

We are unable to connect to plex.tv at this time. Please try again later."

I have also set the Custom certificate location and Custom certificate encryption key sections of my Network settings (as well as Custom certificate domain) but I do not think that is necessary because the nginx is an ssl terminating proxy.

Any thoughts?

I can get a 200 if I append X-Plex-Token: TOKEN to https://media.HOST.com/

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