What is the 502 Bad Gateway Error?
The 502 Bad Gateway error it is an error that tells us that the gateway is incorrect, but this error is completely foreign to your computer, web browser or connection. This error is because the server is not able to correctly process a request, or that one server is receiving an invalid response from another. That is, the The culprit of this error is not you, but the hosting or the web page servers to which you are trying to communicate. Other causes of this error can be due to a data understanding failure between two servers or that the server is not able to process certain tasks.
Web pages often display this error in a number of ways, for example by saying that simply an error has occurred and indicating that it is error 502, as Google does, or a message from the web server appears directly indicating that we have a 502 Bad Gateway error. As we say, this failure depends on the remote server we are trying to visit, so we cannot do anything to solve it. However, we do not have to give up, and although this error appears when visiting a page, there are ways to continue accessing it as we will see below.
Depending on the web server that the web uses, such as Apache or Nginx, the web server that is being used will also appear just below the error, but the “Error 502 bad gateway” part will always appear, in fact, even up to CDN as Cloudflare have a specific website to show this 502 error to their visitors, this usually happens when the CDN cannot communicate properly with the original web server to get the content.
This error is very common when using CDNs or content distribution networks, and it is possible that on some occasions the CDN servers cannot communicate correctly with the hosting web servers. A user makes a web request to a certain page, if it works with a CDN, the request will be received by the CDN directly. Subsequently, a request is made from the CDN to the real hosting web server, this is precisely when the communication error occurs, and the CDN could return the 502 error to the user.
Causes why this fault occurs
The causes for which the 502 bad gateway error usually occurs are related to the web server or communication to the end server, but the error is not found on our own computer. Some of the most common causes are:
- The main web server is down and is not responding to requests.
- The main server has too many requests and is overloaded.
- Communication problems between the CDN and the hosting web server
- If a proxy server is used, it may not be properly configured or able to route the request to the end server.
- The web server is not properly configured or it is a specific failure.
As you can see, the causes that cause this error are multiple. Although in very few cases we can solve this error ourselves, we are going to give you some tips to try to enter a website that returns this error.
How to fix the 502 error
Normally these types of errors are usually temporary, so the first thing we should do is wait a few minutes and try to enter the web page again. In most cases, this is enough to make the web page reload normally. In the case of waiting a few minutes and it is not fixed, you can try to connect with your smartphone using another Internet connection, in case the problem is in the browser’s cache.
Another possible solution is clear the cache of our web browser, sometimes this error is cached, and until we delete it we will not be able to access the website in question. We must bear in mind that CDNs usually use different levels of cache so as not to have to make thousands of queries to web servers, for this reason, it is very important to clear the cache of our browser, and if possible, also the cookies of that particular web that we cannot access. Another very interesting option that you can try is use a different web browserIf you normally use Chrome, try using Firefox or Microsoft Edge to try logging in and see if it returns the same error again.
In the event that it still does not work, the next step will be to try connect to it through a VPN server. It is possible that the saturated server that causes us the 502 error is just in charge of offering access to our network and that, due to a bad load balancing, it is not being derived correctly to a server that is working properly. Thanks to a VPN server, the web will be served by another web server geographically located in a closer location. Therefore, we can try to access our website from another part of the world with a VPN server and see if through this connection it works normally again. Our recommendation is to use VPN services such as Surfshark, PureVPN, NordVPN or similar, which offer us great connection speeds, and the possibility of changing the physical location of the VPN server wherever we want.
Review the DNS servers you use It is also another option that you should not rule out, it is possible that you use a DNS that resolves the domain to a public IP that no longer uses said website, and for this reason you have problems when connecting and it returns the 502 error. Finally , another connection method you could try is use the cache that the different platforms keep on their servers, such as Google. We can visit the web in question using the cache stored temporarily, until the web works normally again is a very interesting option.
If in these ways the web still does not work, there is not much else we can do except wait for the administrators of the page in question to finally solve it.
Have you ever come across a web page that returns the 502 Bad Gateway error?