← All status codes

502

Bad Gateway

The proxy asked the server, and got garbage back.

When to actually use it

Proxies and gateways report this when the upstream returned an invalid response.

Where people mess up

Reading 502 and blaming your app when the real culprit is the load balancer or upstream.

The joke

Two servers talking, and one of them said something that made no sense. 502 is the awkward silence after.