What Is a 502 Bad Gateway Error?

Chyelle Dvorak
Contributing Writer, VPNs
Read More
February 23, 2022
3 min read

We are committed to sharing unbiased reviews. Some of the links on our site are from our partners who compensate us. Read our disclosure policies to learn more.

A 502 Bad Gateway error happens when an edge server isn’t able to receive a response from the origin server (the server that has the information you want). This sounds a lot more complicated than it actually is.

Whenever you access a website, multiple servers that talk to each other back and forth. A 502 Bad Gateway error means there was a problem with the communication with one of the servers. Usually because a server is down.

As soon as these two servers have problems communicating, you’ll see the 502 Bad Gateway error. If you’re curious what you can do to fix or prevent this error and more about why you see it in the first place, we’ve got some answers.

Why am I seeing a 502 Bad Gateway error?

It’s true that you can run into the 502 Bad Gateway error on any browser and on any computer. It happens when there’s a communication error between servers or the server your computer is trying to reach just isn’t available.

There’s more than one reason you’re seeing a 502 Bad Gateway error. Most likely, it’s because the origin server your computer is communicating with is down completely. If this is the case, then your computer is unable to access information from this server. It could also mean the server is down temporarily.

Another reason could be that there’s a faulty firewall. Think of your firewall as a security system protecting your computer from harmful outsiders such as viruses, hackers, malware, and other dangers. Sometimes a faulty or overprotective firewall can make this error appear even when you’re accessing a site that’s safe.

It’s also possible that the domain name servers (that translate domain names into IP addresses) aren’t working. If this happens, you’ll receive the 502 Bad Gateway error and there’s really nothing you can do in this case.

How do I fix a 502 Bad Gateway error?

Here are some basic ways you can try fixing a 502 Bad Gateway error.

Reload the web page. Sometimes servers are having a hard time communicating and there’s a glitch somewhere. You can easily check if it was just a fluke issue by reloading the page. Make sure you wait at least a couple minutes after you see the error—sometimes there’s just a temporary problem with the origin server.

Clear your browser cache and cookies. Sometimes your browser can collect cookies and cache from websites you visit over time. When this happens, your computer can show errors and have problems connecting to servers. Clearing your cache will help you start fresh.

Check for server issues or connectivity issues. Many websites require multiple servers or even use third-party web hosts. If a website is having this error, it could be due to a connectivity issue. The best thing you can do in this case is to wait for the server to finish solving the problem and try accessing the website again at a different time.1

Figure out if there’s a DNS issue. As we talked about earlier, a DNS (domain name system) problem happens when the domain doesn’t resolve to the correct IP address. If you think this might be the problem, you can try what’s called “flushing” your DNS cache. It’s a lot like clearing your cache and cookies but more in depth.

Temporarily disable your firewall. Remember that a firewall is what protects your computer from viruses and malware. Sometimes your firewall is overreacting to a site that’s actually safe. If you use a third-party firewall, try temporarily disabling it to see if that solves the 502 Bad Gateway error.2 If the error goes away, you’ll know your firewall just didn’t like the website you were trying to access.

Now that you know, here are your next steps.
Time for a new internet provider? Find one near you.

Keep your internet access and browsing private.

Chyelle Dvorak
Written by
Chyelle Dvorak
Chyelle works as a freelance writer for The Daily Beast and edited articles for Forbes, Inc.com, Fox News and other review sites. Chyelle tests, writes, and researches products and services related to internet consumption. She found her passion for public speaking and writing in her childhood when she won the Voice of Democracy speech and essay competition. Chyelle has a degree in International Relations from Crown College, Minnesota. Outside of work, Chyelle loves to spend time reading, kayaking, and running.

Related Articles

Best Smart Home Security Systems 2022
Looking for the best smart home security systems with home automation features? See which of...
Cove yard sign
Cove Home Security Review 2022
Cove's home security system is pretty new to the market, but its top-notch equipment is...
ADT sign in a bush near a driveway
ADT Home Security Review 2022
Everyone knows the name ADT, but is its alarm system really the best? Find out...
Photograph of a man using satellite internet on a laptop in rural Australia
The Best Satellite Internet Providers 2022
Find the best satellite internet providers to stay connected in the country. Compare Viasat to...