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.
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.
Related challenges
- The Cert Expires Tonight. Just Bump It to a 10-Year Cert?
Your nginx TLS cert expires tonight and an expired cert took the site down last quarter. A teammate wants a 10-year self-signed cert. Defend the real fix.
- 3 AM Outage: Roll Back or Fix Forward?
A deploy 20 minutes ago correlates with a spike in 500s. You are on call. Defend whether to roll back or fix forward.
- Disk Is at 100% and the App Is Down. rm -rf?
A server is out of disk and the app is down. A teammate wants to rm -rf the logs to free space fast. Defend what you actually do first.
- Pod Stuck in CrashLoopBackOff After a Deploy
A new deploy leaves a pod in CrashLoopBackOff. A teammate wants to bump CPU and memory. Defend how you actually diagnose it.