You are using nginx in front of your application and after a restart or redeployment of your app nginx shows "502 bad gateway".

This is because nginx default behaviour is to resolve any DNS names only once when the server starts and continues using the cached values. A restarted app in will get a new internal IP and then nginx is not finding it. 

Dynamic resolution of upstreams in nginx is only available in Nginx Plus 

For this means you also need to restart your nginx container so it will update the DNS cache.

Did this answer your question?