How To Fix Bad Gateway Error

Bad Gateway Error

Internet Bad Gateway error messages are quite perplexing, with weird symbols that are difficult to justify for the typical user.

But don’t worry; we’ll explain what a bad gateway error is and what to do if you see one.

Every time you enter a URL, it is sent through a gateway.

The server functioning as the gateway, or proxy, got an incorrect answer from the primary server upstream in the event of a bad gateway error.

What is a Bad gateway error?

Bad gateway 502 means there has been a communication breakdown. While the situation is mostly out of your control, there are a few things you may do to help.

Your browser requests a web server every time you visit a website. The web server receives the request, processes it, and then returns the requested resources, together with an HTTP header and an HTTP status code. An HTTP status code isn’t usually seen unless something goes wrong. It’s essentially the server’s approach of informing you that something has gone wrong and providing you with the code to identify the problem.


What is causing the 502 error?

There are several reasons why the bad gateway error notice appears on the website you’re attempting to access.

1. Changes to the DNS

Changes to the Domain Name System (DNS), the communication link between domain names and IP addresses, is occasionally required during server relocation. It may take many hours for this to completely activate.

2. There is a problem with the origin server.

The server may be down, there’s a connectivity issue, or there’s simply too much traffic.

3. The server has gone down.

This can and does occur as a result of an accident or scheduled maintenance.

4. The server transmission is block.

The basic aim of a firewall is to offer protection by blocking transmission between servers. A firewall might sometimes misinterpret safe content for dangerous stuff and stop it in its tracks.


What to Do If You Get a Bad Gateway 502 error

The bad gateway error is frequently caused by a network fault between internet servers, indicating that the issue is not with your computer or internet connection.

However, because it’s conceivable that anything is wrong on your end, try the following fixes:

  • Refresh the page

    By hitting F5 or Ctrl +R  (Command +R on a Mac) on your keyboard, or by selecting the refresh/reload option, you may try loading the URL again.

While the 502 Bad Gateway error normally indicates a networking issue beyond your control, it might also be a very short-term issue. Attempting the website again is frequently effective.


  • Look for faults with server connectivity.

    The majority of websites are hosts on multiple servers . Your website may deliver a bad gateway error page to visitors if your server is offline for maintenance or any other reason.

The only method to resolve this problem is to wait for your server to complete maintenance or to resolve the issue that is generating the error.


  • Turn off CDN or Firewall for the time being.

    It might potentially be a problem with your firewall or content delivery network (CDN). If you’re utilizing a third-party CDN, you can easily troubleshoot this by temporarily turning off your CDN. The free CDN enabler plugin, for example, is one of our favorites. If you’re using it, all you have to do now is disable the plugin and test your site. The CDN connection will be momentarily disable. The same is true for WP Rocket or any other CDN plugin you may have installed.


  • Delete the cookies in your browser.

    Removing saved cookies may cure bad gateway errors for the same reasons as clearing cached files.

If you don’t want to delete all of your cookies, consider deleting only the ones connected to the site where you’re getting the Bad Gateway 502 error. It’s ideal to eliminate them, but it doesn’t harm to attempt the one(s) that seem most relevant first.


As you can see, there are several options for troubleshooting and resolving a bad gateway error problem on your WordPress site. Typically, this is not a client-side issue, but rather a host-side one. Third-party plugins and themes with faulty code or queries that aren’t optimized should  avoid.

Related Articles

Back to top button