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
- Wait one minute and reload the page.
- Do a hard refresh. Press Ctrl+Shift+R, or Cmd+Shift+R on a Mac.
- Open the site in a private window.
- Clear your browser cache and cookies. These are saved copies and small notes kept by your browser.
- 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
- Log in to your hosting control panel.
- If you use WordPress, go to the
wp-contentfolder in File Manager. Rename thepluginsfolder toplugins-off. This turns off all plugins at once. - 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.
- If it still fails, switch to a default theme the same way by renaming your theme folder.
- Look at the Errors or Metrics section in your control panel for messages.
- Check your PHP version in MultiPHP Manager. Change it if the site or a plugin is not compatible.
- If you use a CDN such as Cloudflare, pause it for a moment and test again.
- 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.