HTTP 5xx

502 Bad Gateway

A server acting as a gateway or proxy got an invalid response from the upstream server it was trying to reach.

5xx Server errorCommonly seen

What causes it

  • An upstream app server is down, crashing, or returning malformed responses; a misconfigured reverse proxy.

How to fix it

Check that the upstream application (behind Nginx, a load balancer, or a CDN) is running and healthy. Restart or redeploy the backend if it crashed.

Example response

A typical raw HTTP response a client receives for a 502, with the headers this code is defined around.

HTTP/1.1 502 Bad Gateway
Content-Type: text/html; charset=utf-8

Know before your visitors do.

Sentinel checks your site around the clock from multiple regions and alerts you the moment it starts returning a 5xx error, so you can fix it before it costs you.