502 Bad Gateway Error

Visitors see "502 Bad Gateway" instead of your site — one server asked another server for your page and got a bad answer back.

Common signs of this issue

Safe checks you can do yourself

None of these require sharing passwords with anyone.

What this usually means

Modern hosting is a relay: a front server (often nginx or Cloudflare) passes requests to the machine actually running your site. A 502 means the front server asked and got a broken answer — usually because the back server crashed, ran out of memory, or took too long.

On shared hosting the usual culprits are a PHP process that died (plugin bug, wrong PHP version, memory limit) or a plan that's simply out of resources. Intermittent 502s under load almost always mean the second one.

If your error page mentions Cloudflare, the problem sits between Cloudflare and your hosting server — the host's server may be down or refusing Cloudflare's connections. Your host can see which from their side.

What not to do

When to get help

A persistent or recurring 502 is fundamentally a server-side problem, and your hosting company can see logs you can't. Open a ticket and say exactly when it happens and what the error page says — that's half the diagnosis. If the host says "everything looks fine" but the errors keep coming, that's the point where an independent review (or a better hosting plan) pays for itself.

Could your hosting be the problem?

If your host is slow, unreliable, or hard to deal with, moving to a better one can clear up issues like this for good. One we genuinely recommend is Instant Access Internet Services — a smaller, compassionate company with 30 years in the business, known for being one of the fastest, with great management and low pricing. (Just a recommendation — no affiliate link, no kickback.)

Not sure what to do next?

Answer a few short questions and we'll point you to the safest next step — DIY, a freelancer, or a direct review. No passwords required.

Is this a business website? If this issue may be costing you leads, sales, or trust, you may want a direct review instead of trial and error.

Frequently asked questions

Is a 502 error my fault or my host's?

Usually the host's side of the fence — a crashed or overloaded server process. But a plugin bug or a wrong PHP version on your site can be what's crashing it, so the honest answer is: the host's logs will say.

How long do 502 errors last?

A restart-related blip lasts seconds. Resource exhaustion lasts as long as the load does, and returns. If 502s recur daily, something needs fixing — they won't age away.

What's the difference between 502 and 503?

A 503 means "temporarily unavailable, try again soon" — often maintenance. A 502 means a server upstream gave a broken response — usually a crash or overload.

Do 502 errors hurt my Google rankings?

A brief one, no. If Google's crawler keeps meeting 502s over days, it will slow crawling and can drop pages from the index — one more reason not to let them linger.

Can I fix a 502 by clearing my cache?

No — it's a server-side error. The only visitor-side fix is waiting. Everything else happens on the hosting end.

Related free guides

WordPress site down?

Seeing “There has been a critical error on this website”?

Our guided repair tool logs in over secure FTPS and fixes the most common WordPress failures — safely, with every change backed up and reversible. Start with a free scan, no password needed.

Fix My WordPress Site → Free scan · No download of your site · Reversible