5xx Server ErrorHTTP Status Code Reference
HTTP 502 Bad Gateway— What It Means, Causes & How to Fix It
The server, while acting as a gateway or proxy, received an invalid response from the upstream server. This often indicates a problem with the backend server, not the gateway itself.
Live URL Status Checker
Enter any URL to see its real HTTP response code
Common Causes
- Backend server is down or unreachable
- Upstream server returned an invalid or malformed response
- Network issues between the proxy/load balancer and backend
- Backend server crashed or is being restarted
How to Fix
- 1Check if the backend server is running and healthy
- 2Review proxy/load balancer logs for connection errors
- 3Verify network connectivity between proxy and upstream
- 4Restart the backend server if it's unresponsive
Example
HTTP 502 Bad Gateway
GET /app HTTP/1.1 → Nginx (proxy) → Nginx tries to reach backend at port 3000 → Backend is down → 502 Bad Gateway
Related Server Error Codes
Commonly Referenced Status Codes
The most frequently searched HTTP status codes