Home / HTTP errors / 502 Bad Gateway
HTTP error
502 Bad Gateway
A gateway got an invalid response from the server behind it.
What it means
A proxy, load balancer or CDN passed your request on to an upstream server and got back something invalid, or nothing usable. The front of the site is alive, the part behind it is not answering properly.
Common causes
- The application server crashed or is restarting
- PHP-FPM, Node or another backend is overloaded
- The proxy points to a wrong address or port
- A firewall blocks the connection between the proxy and the backend
- A problem at the CDN or hosting provider
How to fix it
If you are a visitor
- Reload the page after a minute
- Try again later: these errors are often short-lived
If you run the site
- Check that the backend service is running
- Read the proxy error log: it shows why the upstream failed
- Check the upstream address, port and socket
- Look at CPU, memory and process limits on the backend
Catch it before your users do
You can check the status code of any address right now. To hear about 502 errors as they happen, an HTTP(S) monitor requests the page around the clock, compares the response with the status codes you expect and alerts you when it does not match.
Related errors
Start with 10 free monitors
Any monitor type, no card required.