HTTP 502 Bad Gateway
Server error code, RFC 9110, section 15.6.3
What it means
A gateway or proxy received an invalid answer from the server behind it. The server in front is fine; the one behind is not.
A real response
This is the request and the answer our test server gave when we asked it to return 502.
GET /c/502 HTTP/1.1
Host: example.com
HTTP/1.1 502 Bad Gateway
Date: Sat, 14 Nov 2026 10:00:00 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 11
<p>demo</p>If you run the site
Common with reverse proxies (nginx, a CDN, a load balancer): the application behind has crashed, is not running, replied with something that is not valid HTTP, or closed the connection early. Check that the upstream process is running and listening on the port the proxy uses, then read both logs.
If you are a visitor
Wait a minute and reload. It is on the site's side.
A common mistake
Restarting only the proxy when the application behind it is the one that died.
Registered in the IANA HTTP Status Code Registry as Bad Gateway, defined in RFC 9110, section 15.6.3.
This is an independent guide. It is not connected with the IETF, IANA, any browser maker or any company named here. Meanings were checked against the RFC texts on 14 November 2026. Responses shown were recorded on 14 November 2026 from a small test server on the author's own computer.