5xx Server errors
502 Bad Gateway
A server in the middle (proxy, load balancer or CDN) got an invalid response from the server behind it.
Common causes
- The application crashed or isn't running, so the proxy gets nothing useful.
- The app is listening on a different port than the proxy expects.
- The app ran out of memory or workers and dropped the connection.
How to fix it
- Check the application is running and healthy (restart it if needed).
- Check the proxy (nginx, load balancer) points to the right host and port.
- Look at the app's logs around the time of the 502s.
Find out the moment your site returns 502
Spot Downtime monitors count this as down and alert you, since visitors see an error. (The public “Is it down?” checker treats 4xx answers from big sites as online, because many refuse automated requests.)