Domain Email & Office Website WordPress Hosting VPS
Go back
.com
$ 9.99 $ 26.99 /1st year
.org
$ 7.99 $ 24.99 /1st year
Go back
Log in
Control Panel Webmail Website Builder Online Shop File Manager WordPress

What does 502 Bad Gateway mean? + 10 tips to fix the error

When you visit websites, you can encounter an error. For example, a 404 error. Or you see a 502 Bad Gateway on your website. A 502 error can affect your website’s usability, which you want to avoid. In this article, you will read what a 502 Bad Gateway is and find 10 tips to fix the error.

502 Bad Gateway meaning

A 502 Bad Gateway is an HTTP status code you see when you want to view a web page, but the web server cannot complete the request. The web browser wanted to communicate with the server, but it failed. Other names for 502 Bad Gateway are ‘Error 502’, ‘502 Proxy Error’ or ‘HTTP Error 502 – Bad Gateway’.

Building your website on ultra-fast web hosting

Make your dream a success. Host your site on fast, secure and reliable servers.

Get started
  • High-performance SSD servers
  • Easy-to-use Control Panel
  • Free website builder
  • Free SSL certificate
  • Daily backup
  • 24/7 support

How does a 502 Bad Gateway occur?

Several reasons exist why a 502 Bad Gateway occurs. You will find some examples below.

  1. The server is overloaded

When a server has to handle too much traffic or requests without being able to take it, it becomes overloaded. This situation occurs when a website suddenly gets a lot of traffic.

  1. The proxy server gives problems

A proxy server is an intermediary between a web browser and a web server. If the proxy server receives an invalid response from the web server, a 502 error occurs.

  1. The DNS gives a problem

A Domain Name System (DNS) translates a domain name to an IP address so computers can read a domain name. If there is a problem with DNS, the proxy server can’t find the IP address of the web server.

  1. The firewall gives problems

A firewall checks incoming and outgoing network traffic for security. If the firewall is set up incorrectly, it blocks requests from the browser to the web server.

How does a 502 Bad Gateway affect your website?

A Bad Gateway 502 can have a significant impact on your website. For example:

  • The number of visitors drops because they cannot reach your website.
  • Revenue drops because visitors cannot make a purchase.
  • Your website’s reputation drops, and so does your SEO.

Fix Bad Gateway 502

A 502 error occurs because the web server or your web browser gives problems. Below are some solutions to fix the Bad Gateway 502 error.

1. Reload the page

Try reloading the web page. Click on the round arrow in your browser or drag the page down if you use a smartphone.

2. Try Incognito mode

Visit your website in Incognito mode. The Incognito mode will tell whether a browser extension causes the 502 error. Reinstall the extensions one by one to determine which is causing the error. Use these guides to try Incognito mode:

3. Use a different browser or device

Check your website in a different web browser. So you can find out it is your browser’s fault. You check this by uninstalling and reinstalling the browser. Also, try a different device on another network. For example, your smartphone is on mobile data. This solution will determine if the problem is due to your internet network.

4. Empty the browser cache

By cache, website files are temporarily stored so a website loads faster. You may still see a 502 error because the files need to be refreshed. Empty the browser cache using one of the tutorials below:

5. Check the website status

Check whether your website is offline for yourself or other internet users. Go to downforeveryoneorjustme.com and enter the URL of your website.

6. Empty the DNS cache

Have you moved your website to another provider? It usually takes 24 hours for the DNS settings to be changed. Wait this time, or empty the DNS cache. Here’s how to clear the cache:

Windows

Open the Command Prompt and enter the following code followed by an Enter:

ipconfig / flushdns

Mac

Go to the terminal and enter this code followed by an Enter:

Dsacheutil -flushcache

Linux

Open the terminal and enter the following code:

/etc/init.d/nscd restart

7. Disable the firewall or CDN

A CDN is a network of servers that makes the content on your website available faster worldwide. A CDN or firewall can also cause a 502 error. Turn off the CDN or firewall, and see if your website works. Turn them back on and check if you see the 502 error again so you will know that the firewall or CDN is the cause. Contact the CDN or firewall party to fix the problem.

8. Check PHP

A 502 error can also occur because a PHP process takes longer than the time set for ‘max_execution_time’ and ‘max_input_time’. So it would be best if you increased the values. At one.com, you can find the PHP settings by following this guide.

9. Disable WordPress plugins

Are you using WordPress? Then disable the WordPress plugins individually to determine if a plugin is the culprit.

Disabling a plugin through the Admin environment

Do you still have access to the Admin environment of your WordPress installation? Follow the steps below to disable a plugin temporarily:

  1. Log into your website’s Admin environment.
  2. In the Dashboard menu on the left, go to ‘Plugins’.
  3. For a plugin, click ‘Deactivate’.
  4. Check if your website is working again.

Disabling a plugin via FTP

Can’t you get into the Admin environment anymore? Disable the plugins via FTP. At one.com, you use File Manager. Search for the folder containing all plugins and temporarily rename a plugin, for example, by pasting ‘-OFF’ after the name.

10. Contact the hosting provider

Are all the above solutions not helping? Contact your hosting provider. Your provider can help track down the problem. Our customer service team is ready to help you.

Conclusion

A 502 Bad Gateway is an error whereby a server cannot complete your browser’s request. Your website gets offline, which can lead to fewer visitors, conversions and lower rankings in Google. In this article, you have been introduced to 10 tips to avoid a Bad Gateway 502. Good luck!

Building your website on ultra-fast web hosting

Make your dream a success. Host your site on fast, secure and reliable servers.

Get started
  • High-performance SSD servers
  • Easy-to-use Control Panel
  • Free website builder
  • Free SSL certificate
  • Daily backup
  • 24/7 support