HTTP 502 Bad Gateway — Meaning
502 Bad Gateway means a gateway or proxy received an invalid response from the upstream server — e.g. the app behind an L7 load balancer is down or returned invalid headers.
Open the interactive DevRef Hub tool →Key facts
| Status code | 502 |
|---|---|
| Class | 5xx Server error |
| Response example | HTTP/1.1 502 Bad Gateway |
| Spec | RFC 9110 §15.6.3 |
Frequently asked questions
What does 502 mean?
A proxy/gateway got an invalid response from the upstream server.
Common cause of 502?
The upstream app is down behind a load balancer or returned bad headers.
Related pages
HTTP 502 Bad Gateway is part of DevRef Hub on GOAT Lab — a free reference you can use without signing up, and it works offline. Open the tool above for any custom value.
Part of GOAT Lab — 26 free, browser-based science, engineering and developer tools. No sign-up.