Menu

502 Bad Gateway, but the backend is fine: 4 gotchas when your reverse proxy runs on another server
πŸ“°

502 Bad Gateway, but the backend is fine: 4 gotchas when your reverse proxy runs on another server

DEV Community: dockerΒ·Jikwang MoonΒ·about 13 hours ago
#repzbNra
#devtodocker#devto#dev#docker#gateway
Reading 0:00
15s threshold

A very common setup, at home and at work: one small server faces the internet and runs the reverse

proxy in Docker. The actual services live on other machines in the private network.

Internet ──► :80/:443 gateway server (reverse proxy in Docker) ──► 10.0.0.21:8080 wiki ──► 10.0.0.22:3000 app ──► nas.corp.example:5001 NAS

Enter fullscreen mode

Exit fullscreen mode

You add a host, point it at app01:8080 , save, open the site and get 502 Bad Gateway . From your

laptop the service works. From the gateway server itself, curl http://app01:8080 works too.

Here are the four causes I have run into most often, why they happen, and how to check each one in a

minute. They apply to nginx, Nginx Proxy Manager, OpenResty-based proxies and most other proxies

that run in a container.

1.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.