502 Bad Gateway - Server Error Response Status Code

Example Use

A proxy, like Cloudflare, receives a bad response from a web server it sits in front of. The proxy than responds with a 502 error.

Common reasons for this are:

  • Server crash
  • Network failure
  • Excessive server traffic load
  • Application timeout
  • Application blocked
  • Improperly configured server

Official Definition

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.

Source: RFC 7231 Section 6.6.3