In this post, you will learn about what 502 Bad Gateway error is and the causes of it. Besides, to help you fix this problem, MiniTool software provides several corresponding solutions here. Just keep reading to get the detailed information.
About 502 Bad Gateway
When you try to visit a web page, you might receive the 502 Bad Gateway error. This error indicates that one web server has received an invalid response from the upstream server, and thus prevents you getting through the website.
When you get this error, you can see a certain message inside the internet browser window, just like the web pages do. The displayed message could be different in different web servers, and there are some common messages you might see:
- 502 Bad Gateway
- Http Error 502 Bad Gateway
- Http 502
- 502 Bad Gateway Nginx
- Temporary Error (502)
- 502 Service Temporarily Overloaded
- Error 502
- 502 Proxy Error
- 502 Server Error: the server encountered a temporary error and could not complete your request
- Bad Gateway: the proxy server received an invalid response from an upstream server
The reasons for 502 Bad Gateway error could be various. In most cases, the error appears due to online server issues. Besides, you might receive this error if there are some problems with your browser or networking equipment.
Don’t worry if you are stopped by HTTP error 502. You can fix it easily with the following solutions.
Fix 1: Refresh the Page
In some cases, 502 Bad Gateway is a temporary issue and you are able to get rid of it simply by refreshing the page. To reload the page, you can press F5 or Ctrl + R on your keyboard, or click the refresh button beside the address bar.
This may not be always useful, but it just costs you several seconds. If the page cannot load still, try the next way.
Fix 2: Try Another Browser
Don’t hesitate to try another browser if you get HTTP error 502 in a certain browser. If the alternative browser is free from 502 error, there must be something wrong with your original browser.
In case you want to keep using the original browser, you can follow the methods below to troubleshoot the browser. Or, try reinstalling the original one.
Fix 3: Clear Browser’s Cache and Cookies
The outdated or corrupted files stored by your browser could also lead to the 502 Bad Gateway Nginx error. So, you can try clearing the cached files and stored cookies to fix this error.
The steps of clearing cache and cookies are similar in different browsers. Here, I take Google Chrome as an example:
Step 1: Click the three-dot button to open Chrome menu. Then, go to More tools > Clear browsing data.
Step 2: When you get the following window, set the Time Range to All time, and check Cookies and other site data and Cached images and files. Of course, you can choose more items to clear. Then, click Clear data.
Do you know what are cookies in browsers? You can find some basic information about cookies and how to clear cookies on some web browsers in this post.
Fix 4: Start Browser in Safe Mode
What’s more, the add-ons and extensions of your browser might cause this problem as well. In this case, you can try starting your browser in Safe Mode or Incognito Mode. This will make your browser run with the default settings and without add-ons or extensions.
For Firefox, you can open the Setting menu and choose Restart with Add-ons Disabled. After clicking Restart button in the confirmation window, you will get the following dialog, and you just need to click Start in Safe Mode to continue.
Different from Firefox, Google Chrome has not option for you to start in Safe Mode. But Chrome offers Incognito Mode, allowing you run it with all add-ons and extensions disabled.
If the 502 Bad Gateway error disappear in Safe Mode or Incognito Mode, the add-ons or extensions should be responsible for this error. You can reset your browser settings to the default. Or, you can disable the extensions one by one to find the problematic one and disable or remove it.
If the 502 Bad Gateway error still exists in Safe Mode, just move to the next method.
Sometimes, you may find there’s no Incognito Mode in Chrome. Don’t worry! This post aims to provide 4 solutions to Chrome Incognito Mode missing.
Fix 5: Restart Your Devices
If all your browsers run into the problem, you might need to restart your devices, including your computer and networking devices.
It is possible that your computer or networking equipment (router, modem, etc.) are facing some strange and temporary issues. So, a simple restart of these devices could be helpful to fix 502 Bad Gateway error.
Windows 10 keeps restarting? You will find the possible solutions to stopping Windows 10 reboot loop issue by reading this article.
Fix 6: Change DNS Servers
Finally, changing your DNS servers is also a feasible solution to this problem, and it is not hard to complete. Here’s how to change DNS servers.
Step 1: Press Windows + I to open Settings.
Step 2: Go to Network & Internet > Status > Change adapter options.
Step 3: Now, right-click the network you are using currently and choose Properties.
Step 4: Then, choose Internet Protocol Version 4 (TCP/IPv4) and click Properties button.
Step 5: Check Use the following DNS server addresses and input a DNS server address. Commonly, most users would like to use Google’s public DNS server (Preferred DNS server: 126.96.36.199; Alternate DNS server:188.8.131.52). To get more free and public DNS servers, you can check this post.
Once it’s down, the 502 Bad Gateway error should be removed successfully.