HTTP status code
Bad Gateway
A server acting as a gateway received an invalid response from an upstream server.
Something in front of your application — nginx, a load balancer, a CDN — tried to reach your application and got either nothing or something it could not parse. The proxy is working correctly; it is reporting that whatever sits behind it is not.
Check whether the application process is actually running before touching anything else — a 502 most often means it is not. If it is running, confirm the proxy's upstream address matches where the app is listening; a port or socket path mismatch after a config change produces this immediately and consistently. Intermittent 502s during deploys usually mean connections are not being drained before workers restart.
This is one of the most valuable codes to monitor for, because your server responds instantly and the site is completely unusable. Ping checks and TCP checks both pass. Only an HTTP check that inspects the status code catches it.
Monitor for 502 responses freeMost commonly the application behind the proxy is not running or not reachable at the address the proxy expects. The proxy itself is healthy — that is why it is able to return an error page at all.
If you control the application behind the proxy, it is usually yours: the app crashed, or the proxy is pointed at the wrong place. If you are a visitor, there is nothing you can do beyond waiting.
Workers are being restarted without draining in-flight connections. The proxy forwards a request to a worker that shuts down before replying. Graceful reload with overlapping workers fixes it.
Pingura checks your endpoints from five regions and alerts on the status code, not just reachability.
Get Started Free