502 Bad gateway - nginx, uwsgi+django in seperate docker containers
Here is your problem:
upstream uwsgi_django {
server 0.0.0.0:8001;
}
This only "works" if the processes are in the same host, VM or container, because it tries to make a connection to the same machine. When they are in different containers, it does not work.
You need to alter your nginx configuration so that it uses the internal IP address of the uwsgi container. How you do this depends on how you are creating your containers, which you didn't specify. Check the relevant documentation.