HTTP errors are expressed as numbers. You probably heard or saw a 404 error, but it’s hardly the only one in its category. There are lots of other error codes such as 401, and 303 that users see often.
One slightly less common error is the 502 Bad Gateway error that you might encounter at times. This is an HTTP error that normally comes from a server. It means that when you tried to access a website, it sent a request to the server the website is hosted on, and it came back with an invalid response or, a server tried to contact another server and again received an invalid response from it.
This is a general cause for the 502 error but there may be other reasons you’re seeing it. Let’s delve in and learn more about 502 erros and if there are fixes for them.
Other Forms Of 502 Error
The 502 Bad Gateway error isn’t the actual name of the error. It’s really only called a 502 error. The text that accompanies this error varies from website to website. A lot of websites serve their own custom messages for HTTP errors and they might choose to do so for the 502 error. Some have creative error messages for the 404 (page not found) error.
Twitter shows you the Fail Whale when it encounters a 502 error. Github has a Star Wars inspired 404 error message.
The 502 error might be accompanied by the following different messages;
- 502 Bad Gateway
- 502 Proxy Error
- 502 Server Error: The server encountered a temporary error and could not complete your request
- 502 Service Temporarily Overloaded
- 502. That’s an error
- Bad Gateway: The proxy server received an invalid response from an upstream server
- Error 502
- HTTP 502
- HTTP Error 502 – Bad Gateway
- Temporary Error (502)
All these errors are more or less the same and have similar underlying causes.
502 Bad Gateway Error Causes
You might see a 502 Bad Gateway error for the following reasons;
- The server the website is hosted on is unavailable or cannot be reached
- The server is experiencing heavy traffic and unable to respond to all requests or it’s under a DDOS attack
- The server took too long to respond to a request by your browser and the request timed out
- The domain name could not be resolved i.e. the DNS server couldn’t find the IP associated with the address you entered. This might be a problem with the DNS service you’re using.
Fixing 502 Bad Gateway Error
The 502 Bad Gateway error is a server side problem. What this means is that there is little on the end user side that you can do to resolve it. If you’re trying to access a website that is constantly throwing a 502 error, you should try the following;
- Refresh it by tapping the F5 key
- Check to see if it’s just you, or everyone else by entering the domain in Down for everyone or just me
- Check the support page for the domain or their Twitter feed to see if they’re aware of, and have acknowledged there is a problem
- Check back a little later. The site might be down for maintenance or scheduled maintenance might have taken longer or gone bad
- Clear the browser cache and restart your browser. This is highly unlikely to resolve the problem but it’s worth a shot because in very rare cases, a problem with the cache files can throw this error. If you’ve already checked the website on Down for everyone or just me, and it’s up, this might work. Alternatively, try accessing the website in a different browser or a different device like your phone.
- Try using a different DNS service like Google DNS
- Assuming the website is up and the error is only on your side, try restarting your computer and restring your WiFi router.
- Check to see if you can reset your browser. Both Chrome and Firefox have a built-in option that can reset them to their default, fresh install state. Make sure you have your bookmarks and passwords backed up first.
If the website is indeed down and you need to access information on a website urgently you can try to access an archive either via Google Search, or via the Wayback Machine. Be warned that the information may be outdated.