Docker nginx reverse proxy does not work as expected

I’ve been following the nginx reverse proxy setup:


I have plex running with docker on port 32400. which I can hit with: curl localhost:32400

I then have my nginx image running based on the tutorial and setup my plex.conf file inside of nginx and restarted my nginx instance in docker.

However, whenever I curl with the the url is not redirected to my localhost url. Any help would be greatly appreciated.

docker-compose nginx sample:

    container_name: reverse 
    hostname: reverse 
    image: nginx
       - 80:80
       - 443:443
      - ./config:/etc/nginx
      - ./certs:/etc/ssl/private

plex.conf sample for nginx

upstream plex {
  server        plex:32400;

server {
  listen        80;

  location / {
    proxy_pass  http://plex;

1 Like

Did you try localhost:32400 or instead of plex:32400 ?

Yes, I have tried to use localhost and instead of plex for the server definition inside of the upstream.

Did you find a solution to this? I have the same problem and have been trying to fix it for ages. Can’t find anything. :expressionless:

Yeah I was able to find a solution. I’ll share part of my configuration file that helped with this when I get on a computer