Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix the 502 Bad Gateway Error

This guide explains what a 502 error means and gives you simple steps to try to get your website back.

How-To Guides2 min read13 steps

What is a 502 error?

When you open a website, your browser talks to a server. Often that server passes the request to another server behind it. The first one is a gateway. A 502 Bad Gateway error means the gateway got a bad or empty answer from the server behind it.

It is like a waiter who asks the kitchen for food, but the kitchen sends back nothing useful.

Common causes

  • The server is busy or has crashed for a short time.
  • A PHP process stopped or timed out.
  • A plugin or theme has a fault.
  • A firewall or CDN is blocking the request.
  • DNS has not yet settled after a change.

Steps for visitors

  1. Wait one minute and reload the page.
  2. Do a hard refresh. Press Ctrl+Shift+R, or Cmd+Shift+R on a Mac.
  3. Open the site in a private window.
  4. Clear your browser cache and cookies. These are saved copies and small notes kept by your browser.
  5. Try another device or network.

If the other sites work but this one does not, the problem is on the website side.

Steps for website owners

  1. Log in to your hosting control panel.
  2. If you use WordPress, go to the wp-content folder in File Manager. Rename the plugins folder to plugins-off. This turns off all plugins at once.
  3. Reload your site. If it works, a plugin was the cause. Rename the folder back, then turn plugins on one at a time to find the bad one.
  4. If it still fails, switch to a default theme the same way by renaming your theme folder.
  5. Look at the Errors or Metrics section in your control panel for messages.
  6. Check your PHP version in MultiPHP Manager. Change it if the site or a plugin is not compatible.
  7. If you use a CDN such as Cloudflare, pause it for a moment and test again.
  8. Check that your resource use is not at its limit. A busy site can run out of memory.
Tip: Take a backup before you rename or change anything.

Still stuck?

Open a support ticket. Add the page address, the time it began, and what you changed just before.

Quick recap

  • 502 means a server got a bad answer from another server.
  • Reload, clear the cache and test another device first.
  • Owners should turn off plugins, change the theme or PHP version, and pause any CDN.
  • Back up, and ask support if it continues.