Website error guides / Server errors
502 Bad Gateway: what it means and how to fix it
In short: the web server (or a proxy or CDN in front of the site) is working, but the application it passes requests to gave no valid answer.
Common causes
- PHP-FPM, Node, Python or another application server has stopped or crashed.
- The application is overloaded and refuses new requests.
- A proxy or CDN in front of the site can’t reach your server.
How to fix it
- Restart the application server (for example PHP-FPM) and check its log.
- Check the server’s memory and CPU; an overloaded server often causes 502s.
- If a CDN such as Cloudflare shows the error, open the site directly on the server to see where it fails.
Who to contact: your hosting provider or web developer.
Know before your visitors do
PingTurret checks your site from several locations every minute. When it goes down, the alert says the likely cause and who to contact. Free for up to 20 monitors.