What are 502 Bad Gateway Errors?

502 Bad Gateway errors can be exceptionally frustrating because they can happen at any time using any browser on any computer or mobile device. You can even get one when you’re already successfully on a website but you click on a link to another page of the same site.

502 errors happen because one or both of the servers aren’t communicating well.  The root of the trouble can either be on your side of things or the internet’s side.  Before you get too frustrated, there are some simple ways that you can troubleshoot to try and correct the problem.

Client-Side 502 Errors

If the problem is on your side of things:

Try reloading the page

It never hurts to try this right off the bat. Oftentimes, reloading the page is enough to do the trick, but if that doesn’t work, try closing out of your browser and re-opening. For whatever reason, this often fixes the problem.

Try a different browser

If you have multiple browsers on your computer (Chrome, Firefox, Safari, Edge, etc.), try opening the page in a browser that you don’t normally use. If it works, it might mean that you need to clear out your cache or cookies on your original browser or delete some of your extensions.

502 Bad Gateway Errors

(Pixabay / mohamed_hassan)

Try clearing cache and cookies


Unfortunately, the cookies on the internet aren’t the tasty treats you eat with a glass of milk after dinner (and maybe sometimes for breakfast, lunch, and/or a snack), but they can be extremely helpful.

At their most basic, a cookie is a little package of information that is exchanged between your computer and another website that helps the website remember you. This works in your favor when you’re shopping for items online, if you have trouble remembering your passwords, and if you visit certain websites frequently. Cookies make it so you can fill up your shopping cart, log in without scrambling for your password cheat-sheet, and view ads tailored to your purchasing trends.

Even though cookies aren’t inherently bad or good, they can cause some trouble if you have too many, or some of your cookies are actually malware posing as a cookie. If you continuously get 502 errors, it’s best to clear all of your cookies at once, but know that you might lose some of the placeholders you normally don’t even think about. It can be a little inconvenient the next time you try to log in to a frequently visited website, and you have to try to remember which version of your favorite password you used before it locks you out.

Of course, you can always individually select which cookies to delete, but it will probably save you time in the long run to delete them all and input your information again as needed.


Your browser’s cache is designed to keep your computer and internet connection running as quickly as possible. Basically, it downloads a snapshot of images and icons that are consistent across all of the website’s pages and stores them so that you don’t have to keep re-downloading those features when you load a new page on the same site.

Sometimes, however, the cache will get confused or overly full, and you’ll start getting 502 error codes. Clearing your cache is a good way to start afresh, and you most likely won’t even notice any difference.

Restart Your Equipment

“Have you tried turning it off and then on again?” This seems to be every IT specialist’s favorite question – probably because it is so effective! Start by restarting your computer, and if that doesn’t solve the error code, try restarting your modem or other internet connectivity devices.

Come Back Later

Sometimes the best way to fix the problem is to let it resolve itself. If you can afford to come back and try again in a couple of hours, that is a good way to go.

Server-Side 502 Errors

If you’ve tried everything on your side of things, and you’re still getting a 502 Gateway Error Code, it’s time to start looking at the causes outside of your control.

Contact the Website

It never hurts to contact the website if you keep running into the 502 Error. They may already be working on it, but it doesn’t hurt to let them know.

Contact your ISP

It’s possible that the problem could lie with your Internet Service Provider, so feel free to give them a call. They may guide you through some additional troubleshooting steps or confirm that the problem is on their end and that they’re already working on it.

While frustrating, 502 gateway error codes aren’t the end of the world, and they usually get resolved fairly quickly. If (or when) you encounter one, take a deep breath and go through the steps above. They will most likely rid you of that pesky error code so you can move forward on your internet journey.