title: nginx does not listen to pgadmin on docker on port other than 80
body: <p>There are several projects running on my server and I can not use port 80.
  In this Docker, everything works fine except Pgadmin. No matter how much I change the code, I either get a 502 error or a 404 error in &lt;SERVER_IP&gt;:8090/pgadmin/</p>
  <p>Can anyone guide me?</p>
  <blockquote>
  <p>nginx.conf :</p>
  </blockquote>
  <pre><code>upstream app_server {
  server gis_app:8095;
  }
  upstream pg_server {
      server gis_pgadmin:5555;
  }
  
  server {
      listen 8090;
      server_name localhost;
      client_max_body_size 200M;
  
      location / {
          proxy_pass http://app_server;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Host $host:$server_port;
              proxy_redirect off;
      }
  
      location /static/ {
          alias /srv/gis/static/;
      }
  
      location /media/ {
          alias /srv/gis/media/;
      }
  
      location /pgadmin/ {
          proxy_pass http://pg_server;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Host $host;
              proxy_redirect off;
      }
  }
  </code></pre>
  <blockquote>
  <p>docker-compose.yml :</p>
  </blockquote>
  <pre><code>version: '3'
  
  services:
    gis_app:
      container_name: gis_app
      restart: unless-stopped
      build: .
      volumes:
        - .:/srv/gis/src
        - gis_static_volume:/srv/gis/static
        - gis_media_volume:/srv/gis/media
      networks:
        - gis_nginx_network
        - gis_db_network
        - gis_redis_network
      depends_on:
        - gis_db
        - gis_redis
  
    gis_nginx:
      image: nginx:latest
      container_name: gis_nginx
      restart: unless-stopped
      ports:
        - 8090:8090
      volumes:
        - ./config/nginx:/etc/nginx/conf.d
        - gis_static_volume:/srv/gis/static
        - gis_media_volume:/srv/gis/media
      depends_on:
        - gis_app
      networks:
        - gis_nginx_network
  
    gis_db:
      image: kartoza/postgis
      container_name: gis_db
      restart: unless-stopped
      env_file:
        - config/.env
      networks:
        - gis_db_network
      volumes:
        - gis_db_volume:/var/lib/postgresql
  
    gis_pgadmin:
      image: dpage/pgadmin4
      container_name: gis_pgadmin
      depends_on:
        - gis_db
      ports:
      - 5555:8090
      networks:
        - gis_db_network
        - gis_nginx_network
      env_file:
        - config/.env
  
  
    gis_redis:
      image: redis
      container_name: gis_redis
      command: &gt;
        --requirepass password
      restart: unless-stopped
      networks:
        - gis_redis_network
  
  networks:
    gis_nginx_network:
      driver: bridge
    gis_db_network:
      driver: bridge
    gis_redis_network:
      driver: bridge
  
  volumes:
    gis_static_volume:
    gis_media_volume:
    gis_db_volume:
  </code></pre>
  <blockquote>
  <p>and pgadmin env :</p>
  </blockquote>
  <pre><code>PGADMIN_DEFAULT_EMAIL=mail@info.com
  PGADMIN_DEFAULT_PASSWORD=password
  PGADMIN_LISTEN_PORT=5555
  </code></pre>