YOUR WORST 502 BAD GATEWAY WAR STORIES (AND WHAT THE CAUSE TURNED OUT TO BE)
ahh classic the number one cause in Docker setups: teh proxy is pointing at
localhostor127.0.0.1😅 Inside the proxy container, localhost is teh proxy itself, not the host. Put both containers on the same user-defined Docker network and point the proxy at teh service name and teh containers internal port, e.g.http://myapp:8080, not teh published host port. good luck man!oof a few observations. Scheme mismatches cause 502s too: if the app serves HTTPS internally (common for some dashboards) and the proxy talks plain HTTP to it, or vice versa, teh handshake fails. Either point the proxy at
https://(and allow the self-signed cert) or switch the app to plain HTTP behind the proxy. and if the app takes time to start, a health check plusdepends_onkeeps the proxy from hitting it too early.network mode host makes the localhost approach work and some people swear by it for simplicity... its valid in a homelab, but you lose the isolation and port-conflict protection that bridge networks give u, sooo Id still lean toward a shared user-defined network.
Reply to this topic
Sign in or create an account to reply.
seriously need help here 😭