I'm running Nginx Proxy Manager in Docker Desktop with WSL2 on Windows, while Jellyfin is installed directly on the Windows host. I use a DuckDNS domain to reach Jellyfin remotely. This setup worked for about two days, but now the domain returns a 502 Bad Gateway. Nginx Proxy Manager logs show `connect() failed (111: Connection refused) while connecting to upstream` for `http://192.168.x.x:8096/`.
Jellyfin is running and works through `localhost:8096` on the Windows machine. Other devices on my local network can also connect using the Windows host's LAN IP and port 8096. DuckDNS resolves to the correct public IP, and ports 80 and 443 are forwarded correctly. I have tried the Windows LAN IP and `host.docker.internal` as the proxy target, added Windows Firewall rules allowing TCP 8096 on all network profiles, and restarted Jellyfin, Docker, Nginx Proxy Manager, and the computer.
Since the service works from the host and from other LAN devices but not from the container, I suspect this is related to Docker Desktop's WSL2 networking or Windows refusing connections from the Docker network. What should I check next? Please explain any commands or container-network tests in beginner-friendly terms.
3 Answers
The important clue is that Jellyfin works from Windows and the LAN, while the container gets a connection refusal. That points more toward the path between Docker's Linux VM and the Windows host than toward DuckDNS or port forwarding. Try opening a shell inside the Nginx Proxy Manager container and testing the upstream directly, for example with `curl http://host.docker.internal:8096` or `curl http://192.168.x.x:8096`. If the first works, use `host.docker.internal` in the proxy host. If both fail, check whether Jellyfin is listening on an interface reachable from Docker rather than only on localhost, and review the Windows firewall rule for traffic arriving from the Docker or WSL2 network.
Make sure Jellyfin is already running before testing the proxy, then restart or reload Nginx Proxy Manager after confirming that. A refused connection means Nginx reached the target address but nothing accepted the connection there, so checking the upstream from inside the container is more useful than repeatedly checking public DNS or router forwarding.
Docker Desktop on Windows adds another networking layer, and WSL2 does not behave like a normal Linux host network. If direct connectivity tests from the container continue to fail, running both services in the same Docker setup, or moving the stack to a small Linux VM/server, avoids the Windows-host-to-container routing and firewall complications. Simply changing the public domain or port forwarding will not fix an internal upstream connection refusal.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures