jlesage / docker-nginx-proxy-manager

Docker container for Nginx Proxy Manager
MIT License
784 stars 177 forks source link

502 Bad Gateway - connect() failed (111: Connection refused) while connecting to upstream #261

Open pokemaster974 opened 2 years ago

pokemaster974 commented 2 years ago

Hi, I'm blocked since 2 days to success to create reverse proxy to your docker-firefox I verify all of my steps and I don't know why it doesn't work. Any help will be appreciated.

1/ Create the network docker network create

2/ Create the docker-npm container

docker run -d \
    --restart=always \
    --name=nginx-proxy-manager \
    --net=reverseproxy \
    -p 8181:8181 \
    -p 8080:8080 \
    -p 4343:4443 \
    -v /share/Docker/Config/nginx-proxy-manager:/config:rw \
    -e USER_ID=1000 \
    -e GROUP_ID=100 \
    -e UMASK=002 \
    -e TZ=Europe/Paris \
    -e KEEP_APP_RUNNING=1 \
    -e DISABLE_IPV6=1 \
    jlesage/nginx-proxy-manager

3/ Opening forwarding rules into my router External port -> Internal port into my QNAP 4343 -> 443 8080 -> 80 image

4/ Creating the docker-firefox container

docker run -d \
    --name=jlesage-firefox2 \
    --network=reverseproxy \
    -p 5802:5800 -p 5902:5900 \
    -v /share/Docker/Config/jlesage-firefox2:/config:rw \
    -v /share/Downloads:/downloads:rw \
    -e USER_ID=1000 \
    -e GROUP_ID=100 \
    -e UMASK=2 \
    -e TZ=Europe/Paris \
    -e APP_NICENESS=-5 \
    -e DISPLAY_WIDTH=1920 \
    -e DISPLAY_HEIGHT=1080 \
    -e LANG=fr.UTF-8 \
    -e SECURE_CONNECTION=0 \
    -e VNC_PASSWORD=mypass \
    -e CLEAN_TMP_DIR=1 \
    -e "FF_PREF_STARTUP_HOMEPAGE=browser.startup.homepage=about:home" \
    -e "FF_PREF_STARTUP_HOMEPAGE_WELCOME=startup.homepage_welcome_url=about:home" \
    --cap-add=SYS_NICE \
    --shm-size 2g \
    --security-opt seccomp=/share/Docker/Config/jlesage-firefox2/default.json \
    --device /dev/snd \
    jlesage/firefox

5/ Creating my SSL certificate Domain Names : *.nickname.duckdns.org DNS challenge via dns_duckdns_token=my-duckdns-token

6/ Create Proxy Host Domain Names : firefox.nickname.duckdns.org http://jlesage-firefox2:5802 (regarding my name's & ports' used for firefox container) Activing : Cache Assets, Block Common Exploits, Websockets Support SSL : the certificate created in step 5 with Force SSL & HTTP/2 Support

7/ Going to IPNAS:5802 It's working, I can type my password and profit

8/ Going to firefox.nickname.duckdns.org Into my browser : 502 Bad Gateway - openresty Into my nginx logs : [31/Jul/2022:17:53:29 +0200] - 502 502 - GET https firefox.nickname.duckdns.org "/" [Client 192.168.0.254] [Length 154] [Gzip -] [Sent-to jlesage-firefox2] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0"

2022/07/31 17:53:29 [error] 694#694: *61 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.254, server: firefox.nickname.duckdns.org, request: "GET /favicon.ico HTTP/2.0", upstream: "http://172.29.0.3:5802/favicon.ico", host: "firefox.nickname.duckdns.org", referrer: "https://firefox.nickname.duckdns.org/"