502 Bad Gateway
The server received an invalid response from an upstream server.
Definition (RFC 9110)
HTTP status code 502 502 Bad Gateway is defined in RFC 9110 (HTTP Semantics), Section 15.6.3 — the current authoritative specification for HTTP semantics, published June 2022, which obsoletes the older RFC 7231 and RFC 2616.
Description
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.
Common Causes
- Upstream server is down
- PHP-FPM/application process crashed
- Timeout from upstream server
- Firewall blocking upstream connection
- DNS resolution failure for upstream
How to Fix
- Check upstream server status
- Restart PHP-FPM or application process
- Increase proxy timeout values
- Check nginx/Apache proxy configuration
- Verify upstream server health
Check your website's HTTP status code
Check now →