Usually caused by: the website
What does 502 Bad Gateway mean?
Many websites consist of several layers: a web server or proxy like nginx accepts the request and passes it on to the actual application, such as PHP-FPM, Node.js or another server. 502 means this hand-over failed – the application did not answer or answered with garbage.
Often the application process crashed, restarted or is overloaded. CDNs and load balancers also report 502 when they cannot reach the origin server.
Is it me or the website?
It is the website or its host. Shortly after deployments and restarts, 502 often appears for a few seconds.
What you can do as a visitor
- Wait a moment and reload – often it is over after a minute.
- Use our check to see whether the site is affected from all locations.
- If it persists, all you can do is wait.
What you can do as the site owner
- Is the application running? For example check
systemctl status php8.3-fpmor the Node process. - The nginx error log contains hints like “upstream prematurely closed connection” or “connect() failed”.
- With PHP-FPM: is
pm.max_childrenenough for the load? Were there crashes from lack of memory? - Behind a CDN: is the origin server directly reachable?