Docker Containers Are Running but Web Access Returns 502 or Fails Completely

0
0
Asked By MellowPine7! On

I have a Docker Compose setup on Ubuntu 26.04 that worked normally for almost a year. Yesterday, most of the client-facing containers suddenly became inaccessible—around 24 out of 25 services. The containers still appear to be running, their logs continue updating, and scheduled tasks are completing. I can also see activity from the backend, but I cannot open the affected services in a browser.

Using the web URLs returns either a 502 Bad Gateway or a browser error saying the site cannot be reached. I also tried accessing the services through localhost and the host IP with their published ports, as well as using Docker and container IP addresses, but nothing worked. Restarting the containers and rebooting the machine did not help. Portainer itself showed as running, but its web interface was also unreachable on port 9443. The only service still accessible was Plex.

What should I check to determine whether the problem is with Docker networking, the reverse proxy, port mappings, or a firewall?

2 Answers

Answered By RuggedMaple31 On

Check the whole connection path one hop at a time: client to host, host port forwarding, reverse proxy, Docker network, and finally the application. `docker ps`, `docker inspect`, `ss -lntp`, and verbose `curl` requests can show where the connection stops. A firewall or VPN update can also block published Docker ports even when the containers themselves look healthy.

MellowPine7! -

That turned out to be the cause in my case. My VPN had updated and enabled its system firewall, which blocked access to the Docker services. Disabling that firewall restored everything.

Answered By QuietOrbit9 On

A 502 usually means the reverse proxy is reachable, but it cannot connect to the backend container. Check that the proxy and application are still attached to the same Docker network, that the proxy points to the correct container name and port, and that the published port or application port did not change. If possible, bypass the proxy and test the service directly with `curl -v` over HTTP.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.