Code 502

Bad gateway - RFC 7231

The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.

This status code is similar to the 527 error that Cloudflare’s Railgun returns.

sequenceDiagram participant User participant Gateway participant Backend Note right of Backend: Behind Gateway User->>Gateway: Initial request Gateway ->> Backend: Fowards request Backend ->> Gateway: Returns bad response Gateway -->> Backend: Request fails Gateway -->> User: Returns 502 error