4.5 min. read
Every time your site experiences an error, you immediately turn into Sherlock Holmes. You try to investigate what exactly happened and why.
Now you're faced with another issue - 502 Bad Gateway error. You check your internet connection, and it seems to be working fine. You take a look at your computer, but there's nothing wrong with it.
So, why are you experiencing and how can you fix a 502 Bad Gateway error?
Every time you try to open a page, you're sending a request to a web server to access that page. The web server receives and processes your request and sends back the resource you requested together with an HTTP header and HTTP status code.
There's a range of different 500 status error codes, including 500, 501, 502, 503, 504, 505, 507, 508, 510, and more. These 500 status codes indicate that it's a server error. They are no fault of the client, meaning the request you made was good, but the server can not generate the requested resource.
The 502 Bad Gateway error specifically indicates that one server on the internet received an invalid response from another server.
There are various web servers, operating systems, and browsers in use. For example, you might be using a Google Chrome browser and MacOS. Another person, on the other hand, might be using Firefox and Windows 10 OS.
What's more, some websites can customize the way the 502 Bad Gateway error is presented to users.
However, these variations all have the same meaning. One server that was acting as a gateway or proxy has received an invalid response from an inbound server.
The most common ways you might see it include:
502 Bad Gateway
Error 502
502 Server Error: The server encountered a temporary error and could not complete your request
Temporary Error (502)
502. That's an error
HTTP 502
502 Service Temporarily Overloaded
502 Proxy Error
HTTP Error 502 - Bad Gateway
502 bad gateway Cloudflare
The first thing - and the easiest - you should do is try reloading the page. Wait one minute and reload the URL by clicking the refresh/reload button. Or, you can press F5 or Ctrl+R on your keyboard. If the issue gets resolved, then it might have been a temporary connection problem.
If you still see a 502 error, clear your browser cache and then reload the page once again.
In case none of these things work, try some of the tips below.
Have you been thinking about clearing your browser cache but never found the time? Well, now it's a great time to do so!
Why?
Because in some cases, corrupted or outdated files stored in your browser might be the cause of a 502 Bad Gateway error.
What you should do is clear your cache and try loading the page again. If your browser cache was the problem, this would solve the issue.
Using a browser in Safe Mode means to use it with disabled extensions and without add-ons. In this mode, the browser will delete your cookies, searches, and history at the end of the session.
So, whether you're using Chrome, Firefox, or Internet Explorer, enter the Safe Mode and reload your page. If the 502 Bad Gateway error no longer appears, it means that some browser extension or setting is the cause of the issue. In this case, you should go to your browser settings and selectively disable browser extensions to find the one that's causing the issue.
Apart from extensions, another cause might be a plugin. To see whether a plugin is the root of the problem, enable your plugins one by one to find the culprit.
There's always the possibility that your device might be experiencing temporary issues. If you're seeing the same error on multiple sites, then this is probably the case.
In this case, a restart would help.
Also, it's not excluded that your modem, router, or other networking devices are the source of the problem. Restart your networking devices and try loading the page.
Sometimes, 502 Bad Gateway errors are caused by DNS problems. Although this happens rarely, it wouldn't hurt to try.
Your DNS servers are most likely set by your ISP. You can easily change them to a third-party DNS server like Google DNS or OpenDNS.
Most websites are maintained active by third-party hosting providers. One reason for the 502 Bad Gateway error might be that the server is down for maintenance. Make sure you contact your host to find out.
It's always a good idea to get in touch with your host as they will be able to look deeper into what's causing the issue. If they discover that the problem is on their end, then they might be able to fix it quickly. Or, if something's wrong on your end, they can walk you step-by-step through the solution.
Your website can come across many different errors in its lifetime. For example, you'll likely need to use a 301 Moved Permanently or experience a 404 error. When this happens, you want to be prepared.
To help you understand the different types of status codes and their meaning, we've put together a comprehensive HTTP status codes cheat sheet. Hopefully, you'll use it to quickly reference codes and determine what each type of error implies and how you can fix it.
As seen in
&