The 502 bad gateway status code belongs to the 5xx category of HTTP status codes. All 5xx status codes indicate a server error, meaning the problem is within the location where the website is hosted from.
When Would You See 502 Bad Gateway?
Users will come across a 502 bad gateway if the server received an invalid response from the upstream server it accessed while attempting to fulfil the client’s request. Essentially, a user tried to load a page, but the browser displayed an error message because it was unable to retrieve the page from the server.
As with any 5xx status code, an error with your server means your page or even website as a whole cannot display properly. Getting it fixed should be a priority, especially as while your website is down you are losing traffic and potentially slipping down the SERP rankings.
What Causes 502 Bad Gateway?
- Server overload
- Network errors
- Server software timeouts
If ever there was a HTTP status code to accompany the famous ‘computer says no’ sketch, then a 502 bad gateway is it. From overzealous firewalls that block the site because it perceives a security threat, to problems with the domain’s DNS – the communication has failed somewhere along the chain between server and client.
A good way to tell whether the problem lies within your computer or the website itself is to check the website on another browser. If you commonly experience 502 bad gateway errors, then the issue is likely on your machine or browser.
However, most of the time a switch has effectively been turned off in the inner workings of the website’s server. It could have an outdated security certificate or simply have issues with its hosting platform.
What Does Gateway Timeout Mean?
Time is of the essence, even in the world of HTTP status codes! A gateway timeout quite literally means the client did not receive a timely response from the server.
Think of it as ordering a taxi but it didn’t show up, so you decided to walk instead. The client (browser) has attempted to load the page from the server, but it’s taken so long that it has said ‘not good enough, sorry’ and generated a gateway timeout error instead.
Website owners need to take gateway timeouts seriously because performance affects user retention. If it’s at the stage where your users are getting a gateway timeout message, this is even worse and certainly not good for your SEO. So, work on addressing the issues to ensure fast, reliable connectivity.
How to fix a bad gateway
In the first instance, try refreshing the page. Although the bad gateway is usually out of the user’s control, sometimes enough time has elapsed in between the error occurring and you refreshing it to have been fixed.
You can also try opening up the page in another browser or clearing your browser’s cache. Clearing your cookies is another idea, though isn’t always as popular due to the slight hassle this can create for logging into websites. Sometimes it’s necessary though, especially if it’s been a while since it was last done or you’ve noticed other problems when browsing the internet.
Pasting the URL into Down Detector can also shed some light on whether it’s just you having the issue or everyone else.
If it’s your own website that has the 502 bad gateway message, then paste the URL into Google Console to see if you can identify any errors. Sometimes the issue can be with your domain provider or web host, so you may need to contact them to get it resolved.
To Sum Up
With a 502 bad gateway status code, the clue is in the name. When users come across this as they are browsing your website, they are likely to make a hasty exit.
Usually, the source of the problem lies within your web host, seen as all 5xx status code errors are server orientated. So, take swift action if you notice it on your website.
If you’re simply browsing another website, refresh and come back later or contact the website owner to inform them of the error.