Tutorials

What does 502 bad gateway mean? How to solve it?

Table of contents:

Anonim

The 502 Bad Gateway error is an HTTP status code which means that a server on the Internet received an invalid response from another server. 502 Bad Gateway errors are completely independent of your particular configuration, which means you can see one in any browser, on any operating system, and on any device. In other words, it can be personalized by each website. While it is quite common, different web servers describe this error differently.

Index of contents

Here is a list of some common ways we can see it.

How the 502 Bad Gateway error appears

502 Bad Gateway

502 Service temporarily overloaded

Error 502

Temporary error (502)

502 proxy error

502 Server error: the server encountered a temporary error and was unable to complete your request

HTTP 502

That is an error

Bad Gateway: The proxy server received an invalid response from an upstream server

HTTP Error 502 - Bad gateway

The 502 Bad Gateway error appears within the Internet browser window, just like web pages.

For example, Twitter's famous "whale bug" that says Twitter is over capacity is actually a Bad Gateway 502 error (although a 503 Error would make more sense).

A 502 Bad Gateway error received in Windows Update generates an error code 0x80244021 or the message WU_E_PT_HTTP_STATUS_BAD_GATEWAY.

When Google services, like Google Search or Gmail, experience a 502 Bad Gateway, they often show Server Error, or sometimes just 502, on the screen.

Cause of a 502 Bad Gateway error

Bad Gateway errors are usually caused by problems between online servers over which we have no control. However, sometimes, there is not a real problem, but our browser believes that there is one thanks to a problem within it, a problem with the home network equipment, or some other reason that is under control.

It is important for me to mention that Microsoft IIS web servers often provide more information about the cause of a specific 502 Bad Gateway error by adding an extra digit after 502, as in HTTP error 502.3: the web server received an invalid response while It was acting as a gateway or proxy, which means Bad Gateway: Forwarder Connection Failure (ARR). Microsoft provides a list of all the response codes associated with a 502 in its official documentation.

One tip, in the case of HTTP error 502.1 - Bad gateway error, it refers to CGI application timeout issue and better to fix it as 504 Gateway Timeout issue.

You may be interested to read: Chrome 68 will consider all HTTP websites insecure

How to fix the 502 Bad Gateway error

Now how do we fix a 502 Bad Gateway error ? As we already know that often the error corresponds to a network error between servers on the Internet, which means that the problem would not be in our computer or Internet connection.

However, since there may be a problem on our part, here are some solutions to try:

Reload the page or restart the browser

Try loading the URL again by pressing F5 or Ctrl-R on the keyboard, or clicking the refresh / reload button in the browser. While the 502 Bad Gateway error generally indicates a network error beyond your control, it could be extremely temporary. Retesting the page frequently could be successful.

Another option may be to start a new browser session, closing all open browser windows, and then opening a new one. After that, try to open the web page again.

It is possible that the 502 error we are receiving is due to a problem in our computer, which occurred sometime during the session we have in the browser. A simple restart of the browser program could solve the problem. So it never hurts to try!

Delete navigation files

Clearing your browser's cache could also resolve a 502 Bad Gateway error. Outdated or corrupted files that the browser is storing could be causing it. So let's remove those cached files and try the page again. The problem will be solved if this was the cause.

Delete cookies from your browser. For reasons similar to those mentioned above with cached files, deleting stored cookies could correct a 502 error. If you prefer not to delete all your cookies, you can first try to delete only the cookies related to the site where you receive the 502 error. The best is to eliminate them all, but first we can test the clearly applicable ones.

Safe or failsafe mode

Start your browser in safe mode. Running a browser in Safe Mode means running it with default settings and without plugins or extensions, including toolbars.

If the 502 Bad Gateway error no longer appears when you run your browser in Safe Mode, you know that the cause of the problem is some browser extension or configuration. Return your browser settings to the default settings. Then selectively enable / disable browser extensions to find the root cause and fix the problem permanently.

Safe mode of a browser has an idea similar to Safe mode in Windows, but it is not the same. You don't need to start Windows in Safe Mode to run any browser in its "Safe Mode".

Toggle browser

Try a different browser. Popular browsers include Firefox, Chrome, Safari, Internet Explorer, among others. If an alternative browser does not produce a 502 Bad Gateway error, you now know that your original browser is the source of the problem. Assuming you've followed the troubleshooting suggestion above, now would be the time to reinstall your browser and see if that fixes the problem.

Restart your computers

Restart your computer. Some temporary problems with your computer and the way they connect to the network could be causing 502 errors, especially if you are seeing the error on more than one website. In these cases, a restart would help.

Restart your network equipment. Problems with a modem, router, switches, or other network devices could be causing 502 Bad Gateway or other 502 errors. A simple reset of these devices could help us.

The order in which you turn off these devices is not particularly important, but be sure to turn them on again.

DNS configuration

Change your DNS servers, either on your router or on your computer or device. Some Bad Gateway errors are caused by temporary problems with DNS servers.

Unless you have previously changed them, the DNS servers you have configured at this time are probably the ones automatically assigned by your ISP. Fortunately, there are several other DNS servers available for you to choose from. You can consult different lists of public and free DNS servers, available on the Internet.

Particular cases

If you have MS Forefront TMG SP1 installed and you receive the message Error Code: 502 Proxy error. The network login failed. (1790) or a similar message when accessing a web page. Download update 1 for Microsoft Forefront Threat Management Gateway (TMG) 2010 Service Pack 1.

Of course, this is not a common solution for proxy 502 error messages and only applies in this particular situation. Forefront TMG 2010 is an enterprise software package and you will know if it is installed.

Try to contact

Assuming you've already tried everything, contacting the website directly might also be a good idea. Chances are, assuming they're at fault, website administrators are already working to fix the cause of the 502 Bad Gateway error, but don't hesitate to report it.

See the website's contact information page for additional information. Most websites have social media accounts that they use to help their services. Some even have contacts by phone and email.

Additionally, if you suspect a website is down for everyone, especially a popular one, checking Twitter to talk about the cut is often very helpful. The best way to do this is to search for #websitedown on Twitter, such as #cnndown or #instagramdown.

On the other hand, contact your Internet service provider. If your browser, computer and network are working and the website reports that the page or site is working for them, the 502 Bad Gateway problem could be caused by a network problem from your provider.

If so, try later. At this time, the resolution of the problem is no longer in your hands. Either way, you're not the only one seeing the 502 error and you'll have to wait until the problem is solved for you.

Errors like 502 Bad Gateway

The following error messages are related to the 502 Bad Gateway error:

  • Internal Server Error 500503 Service Unavailable 504 Gateway Timeout

There are also several client-side HTTP status codes, such as the very common 404 Not Found error, among many others that can be found in the HTTP status code error lists.

And with this we come to the end. I hope all the information is useful to you. I invite you to leave your experience in the comments. Did you have a 502 Bad Gateway error? How did you solve it?

Tutorials

Editor's choice

Back to top button