502

HTTP 502 Bad Gateway

5xx Server Error

  1. Home
  2. > HTTP Status Codes >
  3. > 5xx >
  4. 502
5xx Server Error RFC 7231, Section 6.6.3

What is HTTP 502 Bad Gateway?

The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an upstream server. This commonly occurs when a web server (like Nginx) receives an invalid or no response from an application server (like PHP-FPM, uWSGI, or a reverse proxy target).

Common Use Cases

  • Application server crash behind reverse proxy
  • Upstream service timeout
  • PHP-FPM process unavailability
  • Load balancer with unhealthy backend
Help2Code Logo
Menu