Few errors are as frustrating as 502 Bad Gateway — especially when you need a site right now. The good news: it's usually temporary, and there are smart moves for both visitors and site owners. Here's the complete guide.
What does 502 Bad Gateway actually mean?
A 502 means a server acting as a gateway or proxy received an invalid response from another server behind it. In plain English: the website's "front door" is open, but the room behind it isn't answering properly. It's a server-side error — the site really has a problem, as explained in our HTTP status codes guide.
Fixes for visitors (try in this order)
- Refresh after 30–60 seconds. Most 502s are brief overloads during traffic spikes or deployments.
- Check if it's down for everyone with our website down checker — if our server also gets a 502, waiting is your only option.
- Hard-reload (
Ctrl + F5) to bypass a cached error page. - Clear browser cache or test in incognito mode.
- Switch DNS to 1.1.1.1 — occasionally a broken CDN edge served by your resolver is the culprit.
Fixes for site owners
- Check your origin server — is the PHP/Node/app process running? A crashed backend is the #1 cause.
- Read the error logs (
/var/log/nginx/error.logor your host's panel) for upstream timeouts. - Overloaded server? Check CPU/RAM; scale up or enable caching.
- Firewall or plugin blocking — a bad WordPress plugin or mod_security rule can kill responses; disable recent changes.
- CDN misconfiguration — if you use Cloudflare, see our Cloudflare errors guide.
Monitor it so you know before customers do
Set up free uptime monitoring for your domain: we check every ~15 minutes and email you the moment your site starts returning errors like 502. You can also watch any major site's status page for live 24-hour history.