502 Bad Gateway
A gateway or proxy got an invalid response from the server behind it.
What to do
A proxy or gateway got a bad response, or none, from the server behind it. Check the upstream is running and listening where the proxy expects. The proxy's error log names the reason.
- Class
- 5xx Server Error. The server failed to fulfill a request that looked valid.
- Registered
- Yes, in the IANA HTTP status code registry.
- Cacheable by default
- No. A cache stores it only when Cache-Control or Expires says to.
- References
- RFC 9110 ยง15.6.3 · MDN
Every 5xx code
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 506 Variant Also Negotiates
- 507 Insufficient Storage
- 508 Loop Detected
- 510 Not Extended
- 511 Network Authentication Required
- 520 Web Server Returns an Unknown Error
- 521 Web Server Is Down
- 522 Connection Timed Out
- 523 Origin Is Unreachable
- 524 A Timeout Occurred
- 525 SSL Handshake Failed
- 526 Invalid SSL Certificate
- 530 (No name)
- 561 Unauthorized