Skip to content
MtrXTools

502 Bad Gateway

The proxy got a bad response from the server behind it

Seen in nginx, load balancers, CDNs

A reverse proxy or load balancer reached your application and got an invalid response, or no response.

Common causes

  • The application crashed or isn't running.
  • The proxy points at the wrong upstream port or socket.
  • The upstream closed the connection or returned malformed headers.

How to fix it

  1. Check the application is running and its logs.
  2. Check the proxy's upstream address and port.
  3. Look at the proxy error log for the exact upstream error.
Check the response

Got a different message? Paste it into the error explainer.

Related errors

All 51 HTTP & CDN errors