Server error
HTTP 502: Bad Gateway
HTTP 502 means a gateway received a bad response from an upstream server.
Meaning
A proxy, gateway, or load balancer could not use the response from another server.
Common causes
Upstream crashes, invalid responses, DNS issues, or proxy misconfiguration can cause it.
What to check
Check upstream health, gateway logs, DNS, TLS, and proxy timeout or routing settings.
Example response
HTTP/1.1 502 Bad GatewayReferences
- Registry
- IANA HTTP Status Code Registry
- Spec
- RFC 9110 §15.6.3
- Guide
- MDN 502 Bad Gateway
Related HTTP status codes
Nearby codes often answer the next debugging question.