If you’ve been browsing the web for a while, you might have observed the 502 bad gateway error sometime. Fret not, we will help you to understand, analyze and potentially fix the 502 bad gateway error.
“502 Bad Gateway Error” is an HTTP status code that tells you that something’s wrong with the website/web service you are trying to access or visit.
Specifically, the 502 bad gateway error means that the proxy server received an invalid response from the origin server (or the upstream server).
In other words, the web service (or the site) that you try to access resides on a web server – but they further utilize a proxy server or a service like Cloudflare to protect their original server. “Proxy” means intermediary here.
Browser <==> Proxy <= issue => Website
It is pretty self-explanatory – but you just have to look at the error code “502“. You might observe creative texts/pages for the error but the number (or code) will help you identify the error.
You might be able to fix the error – but only if it is an issue from your end (your PC, browser, OS, etc).
So, before trying to fix the error, we can analyze the issue to make sure that it is not a problem from their end (the website you are trying to visit).
It is quite easy to utilize some of the online tools available to check whether the issue persists for you alone or if there’s a fault in the web server of the website.
Google’s PageSpeed Insights is a tool meant for web developers to check the performance of their website and make changes accordingly.
Basically, it acts as a remote computer for you to load up a webpage and see if it is working (that is how we are going to use it here).
If the URL you entered works completely fine using the PageSpeed Insights, you will observe a speed score of the website along with a snapshot of the website (how it looks like when it loads up).
If everything looks fine – you need to fix something from your end. In other words, you will have to try the solutions mentioned in the later section of this article to resolve it.
No matter what browser you are using – simply switch to the private browsing mode (or the incognito mode) to ignore the cache/cookies stored on your browser and try to access the website.
If you can access the website then it is probably a caching issue, which can be easily fixed. If you still get the same error, you should try loading up the website using another browser (suppose you are using Mozilla Firefox, try using Google Chrome to access the issue).
Do note that these solutions are intended for visitors only. If you are a web developer or an administrator of a web server, you have to check your origin server configuration and troubleshoot the issue.
This sounds ridiculous but sometimes the error is temporary and simple reload helps you access the website without any issues. So, you need to try doing that first. Press F5 on PC, and Cmd + Shift + R to hard-refresh on Mac.
You can refer to our guide on how to clear browsing data on Chrome, Firefox, and Edge to easily clear cache/cookies. Once, you’ve cleared it, try reloading the webpage again. As mentioned above, you can simply launch a new incognito browser tab, which is like a fresh browser.
If the above two solutions do not work, you can simply try to change your DNS server. You can either choose to change the DNS on your router or on your Windows machine.
If your ISP (Internet Service Provider) is at fault, you can try using a VPN and then access the website to see if it works.
If you have a lot of extensions installed on your browser, try removing the ones you do not need. Sometimes the browser extensions cause a lot of issues – so you can try doing that as well.
Sometimes restarting your system (and your network equipment) does the trick. So, why not try it out if nothing else works for you?
Now that you know all the potential solutions to fix the “502 bad gateway error“, it should help you troubleshoot the issue, but ultimately, if that’s an issue with the website itself, you may just have to wait for it to be back on line.