In today’s day and age, everyone uses the internet. Often, when using the internet, and visiting web pages, there can be connectivity problems between the computer and the website. These connectivity problems come up with certain error codes referred as HTTP status codes. These codes are classified as 1xx, 2xx, 3xx, 4xx and 5xx based on the type. All 5xx status codes are received from the server side due to different reasons.
What is 502 Bad Gateway Error?
502 bad gateway is one the examples of 5xx HTTP status codes returned by the server. This error means that one of the servers has received an invalid response from the other. These servers connect through their “DNS”, which is essentially an online phone book for different connections on the internet.
Where Can This Error Occur?
The “502 Bad Gateway” error, much like other connection errors, can occur on any device, any browser or any application that connects to the internet. Remember “504 Gateway Timeout” and “503 Service Unavailable” errors are different that of “502 Bad Gateway” error. Though all 5xx errors are returned due to problems at server side in general.
Is the Error Related to Your End of the Connection?
The “502 Bad Gateway” error isn’t necessarily related to your end of the connection. These errors are likely caused by the online server, and not yours. Sometimes, the error is a tiny fault, and there may not actually be an error there, the browser is just thinking that there is. However, in saying this, there are several ways that this can be checked.
How to Fix 502 Bad Gateway Error?
Below are some possible ways to fix the problem, do each of them in order, and move on to the next if the previous one doesn’t work.
1. Reloading the Page
This is by far the best thing to try first, as most online server errors are only temporary, and can be resolved with a simple reloading of the page. Click on the refresh button or F5 page to reload the webpage again.
Remember not to reload the pages when you are doing payment other form submission to avoid duplication.
2. Close and Re-Open the Browser
This is the next best option. Try starting a new browsing session by basically closing all your active browser windows and tabs, and then opening the browser again, and trying to load the page once more.
3. Clear the Browser Cache and Cookies
Often when there is a browsing error, the cache has become cluttered and has started causing problems with the processing of new server addresses, due to the likely build-up of other server addresses. It can be a good idea to clear this on a regular basis. This can be done by opening the settings or tools menu in your browser and clearing the history.
While there, it can be a good idea to clear the browser cookies as well, as this may relate to the problem, and is often just an extra tick box when clearing the cache, depending on the browser.
4. Use Incognito or Private Browsing
Sometimes the plugins and extensions installed on your browser may cause conflict with the response received from the server. It is a good idea to disable them and check the site can be opened without issue. The easiest way to do is to open the browser in private or incognito mode.
Incognito mode disables all extensions and will help to narrow down the issue if at all it is related to your extensions.
5. Open the Webpage with Another Browser
The problems may well be related to the browser software itself, so try opening the page with a different browser. For example, if using Google Chrome, open it with Microsoft Edge.
6. Restart Your Computer and Modem/Router
Sometimes, a computer can have temporary issues with connecting to online servers, so it’s a good idea to try and restart the computer. While the computer is restarting, restart the modem/router that you are connected to. Once the computer and the modem/router are back up, try opening the page again.
7. Check Your DNS
DNS generally speeds up the internet connection but sometimes wrong cache in your browser or PC or ISP side may cause the error. Follow the steps in this article to clean up the DNS cache – flush DNS in Windows 10.
8. Use Public DNS
There are countries like China where internet is censored. 502 dad gateway error more likely to occur because of the DNS servers. The local DNS servers will take long time resolve the global site addresses. In such a case try using Google public DNS instead of default DNS from ISP.
9. Use VPN or Proxy Server
If public DNS does not work, try using reliable VPN or proxy server. This will help to bypass all corrupted local DNS servers and use private DNS to access the sites. Using VPN you can easily switch the server and access the site similar to accessing from local location.
10. Contact the Website Administrator
If all the above fails, the problem likely isn’t on your end, and it’s definitely a good idea to try and approach the website administrator, so that they can try and fix the problem as quickly as possible. Especially when you see the 502 bad gateway error from Cloudflare, inform the site owner so that they can setup the CDN properly.
If you don’t find the email address of the site owner, just drop a mail to “firstname.lastname@example.org”. In most cases, site owners will use catch all email to collect all emails addressed to one single id and then respond accordingly.
11. For a Website Owner
Below are additional steps you can take if you are the website owner:
- Check your DNS propagation if you have done any changes in DNS zone file
- Check server log file
- Check caching and CDN setup
Above are the different possible solutions you can try to fix 502 bad gateway error. If none of the above helped you to access the site then rest assured that the problem at the server side. All that’s left to do at this point is to wait and see if the website gets fixed and come back another time.