502 Bad Gateway Right After a Deploy

The site returns 502 from nginx after a deploy. A teammate wants to tweak the nginx config. Defend where you actually look first.

beginner8 min4 roundsEasy mode availableNginx

Answer key reviewed by Branko Petric

Your decision

Right after a deploy, your site returns 502 Bad Gateway from nginx. A teammate says it is nginx, let us tweak the nginx config and reload. Where do you actually look first, and why?

The situation

You ship a routine deploy. Within seconds the site starts returning 502 Bad Gateway from nginx for every request. It was working right before the deploy.

Context

nginx reverse-proxies to your app on a fixed local port. The deploy replaced the app build and restarted the service. A teammate insists the problem is nginx and wants to start editing /etc/nginx and reloading.