Why did 502 resolve after clearing up the docker network?

I can’t explain that, but I wouldn’t try to guess without a more verbose error message. When there is an HTTP 502, that is returned by a server and when a server returns that, it has to know why. When I wrote about error messages, I didn’t mean the container that couldn’t be reached but the proxy server that was supposed to reach it. Your nginx reverse proxy.

Your networks in the compose file are external. So there is no way to tell what else is on that network if we assume the reverse proxy was trying to reach another container.

I’m replying only now because I found it hard to connect the pieces together. Like what is network A and B and which is which in your compose file or which network is used by the proxy server and whether the compose file is the original setup or the fixed one. If you explained it, I missed it, but when you simplify things, it is better if you use the right names to refer to. After reading the updated post the multiple times, I understand today that is is the new compose file as you have two networks.

So if you can reproduce the issue again with the original setup and configure your reverese proxy to show you a verbose error message, I can’t promise, but at least there is a chance that we can give you a better answer.

I wouldn’t rule out a weird docker network error completely, but I wouldn’t jump to that conclusion yet either

Can you also tell more about you Docker environment?

We usually need the following information to understand the issue:

  1. What platform are you using? Windows, Linux or macOS? Which version of the operating systems? In case of Linux, which distribution?

  2. How did you install Docker? Sharing the platform almost answers it, but only almost. Direct links to the followed guide can be useful.

  3. On debian based Linux, the following commands can give us some idea and recognize incorrectly installed Docker:

    docker info
    docker version
    

    Review the output before sharing and remove confidential data if any appears (public IP for example)

    dpkg -l 'docker*' | grep '^ii'
    snap list docker
    

    When you share the outputs, always format your posts according to the following guide: How to format your forum posts