If your website is returning 5xx server errors, you may be confused about what it means and what you need to do about it.
Don’t panic! This article will cover everything you need to know to become an expert, so you can confidently find and fix any 5xx server errors that occur on your website.
Introduction to HTTP Response Status Codes
When a server receives an HTTP request, it responds with a status code which tells the client if their request was successful, and if not, what went wrong.
There are five classes of status code, grouped according to their first digit:
* Codes starting with 1 are informational
* Codes starting with 2 indicate a successful response
* Codes starting with 3 indicate a redirection has occurred
* Codes starting with 4 are client error codes
* Codes starting with 5 are server error codes
This article is a comprehensive guide to the server error codes 5xx.
When a server responds with a 5xx error code, it indicates that the server has encountered an error that is preventing it from fulfilling the request.
The server should then send an explanation of the error and whether it is temporary or permanent.
Do You Need to Worry About 5XX Server Errors?
If you’re responsible for a website, you definitely need to know if any valid requests are returning 5xx server errors.
At the very least, these indicate that your users aren’t seeing the pages or images they’re requesting. That’s a bad user experience that will harm your site’s reputation with its users.
From an SEO perspective, Google and other search engines are also likely to take a dim view of pages that consistently return 5xx server errors instead of content.
Google won’t want to send their users to those pages as they know they represent a bad user experience, so you can expect those pages to be removed from Google’s results until they stop returning 5xx errors.
Understanding 5XX Server Error Codes
The official list of valid HTTP status codes is defined by IANA – The Internet Assigned Numbers Authority.
You can find the official list of 5xx status codes here.
Official 5XX Status Error Codes
Status codes recognized by IANA are classed as official status codes and are widely supported.
500 Internal Server Error
This is probably the 5xx error you’ll see most often, and it’s also one of the most enigmatic. The server is basically shrugging its shoulders and saying, “something went wrong,” which gives you very little to go on when trying to fix the problem.
This obscurity can sometimes be a worthwhile security feature: Microsoft’s IIS used to report coding errors with detailed information on what went wrong at which line of code.
This information was a security risk: Although it was useful to programmers trying to fix the error, it was invaluable to hackers wanting to attack the website.
Later versions of IIS simply report a 500 Error unless you’re logged in, which allows developers to fix the site without revealing useful information to hackers.
501 Not Implemented
This error code means that the server doesn’t support the functionality needed to fulfill the request.
502 Bad Gateway
If a server doesn’t receive responses from other servers that it needs in order to fulfill a request, it should return a 502 Bad Gateway status code.
A server that is temporarily unable to fulfill a request can return a 503 Service Unavailable error.
This usually means that the server is overloaded or undergoing scheduled maintenance and should be able to fulfill the request in the future.
When this error is returned, the server may also send a Retry-After header to indicate when another attempt at the request may be successful.
504 Gateway Timeout
When a server returns this error, it indicates that it is a gateway or proxy for an upstream server and it didn’t get a timely response from that upstream server.
505 HTTP Version Not Supported
A server returning a 505 error code is telling the client that it doesn’t support the major version of HTTP used in the request received from the client.
The server should also describe why it doesn’t support that version and what protocols it does support.
506 Variant Also Negotiates
The Transparent Content Negotiation protocol is used to allow clients to receive the best variant of a resource if the server offers more than one variant.
If the chosen variant is also configured to negotiate, then it’s not a valid variant for this protocol, and this error is returned by the server.
507 Insufficient Storage
This status code may be returned when the WebDAV (Web Distributed Authoring and Versioning) protocol is in use.
It means that the server cannot complete the request because it can’t store the representation needed.
508 Loop Detected
This status code may be returned when the WebDAV protocol is in use, which means that the server has detected an infinite loop, and the operation will never complete.
The 509 status code has not been defined.
510 Not Extended (Obsoleted)
This status code indicates that an extension requested by the client is not supported by the server.
This status code has been obsoleted.
511 Network Authentication Required
The 511 status code is usually returned by a proxy server that controls access to the network.
It means that the client must provide authentication to gain access to the network before their request can be fulfilled.
512 – 599 Unassigned
Status codes from 512 up to 599 have not yet been assigned and have no official meaning recognized by IANA.
See the next section for details of some status codes within this range that have been used by certain organizations unofficially.
Unofficial 5XX Status Codes
In addition to the status codes recognized by IANA, some organizations have created their own 5xx status codes for their products.
Here are a few unofficial status codes that are quite commonly used, grouped by the organization that created them:
Amazon Web Services
This authorization error may be returned by a server registered with the Amazon Web Services “Elastic Load Balancer.”
It is returned if the Identity Provider cannot authenticate the user.
Apache / cPanel
509 Bandwidth Limit Exceeded
Web hosts often limit the amount of bandwidth customers paying for a specific package can use. This allows them to charge more for hosting packages that include more bandwidth and to make sure that a customer using excessive amounts of bandwidth doesn’t harm the experience of other customers.
If a customer exceeds the bandwidth included in their hosting package, people visiting their website may receive a 509 Bandwidth Limit Exceeded status code to explain why the content they requested is not being served.
Cloudflare is a CDN (Content Delivery Network) that aims to improve the performance and availability of websites by making them available from proxy servers located closer to the client than the origin server.
This hosting company has created a number of unofficial 5xx server errors, which they use to indicate that they’ve encountered a problem with the origin server.
Despite being unofficial status codes, the popularity of Cloudflare’s services means you are quite likely to encounter one or more of these error codes.
520 Web Server Returned an Unknown Error
This is Cloudflare’s equivalent of the 500 Internal Server Error – it indicates that something went wrong with the origin server but is very unspecific about what the problem might be.
521 Web Server is Down
When Cloudflare’s servers cannot connect to the origin server, they return a 521 Web Server is Down error to clients trying to access the site.
522 Connection Timed Out
When Cloudflare’s servers attempt to contact a website’s origin server and the connection times out, they may return a 522 Connection Timed Out status code to clients trying to access that website.
523 Origin is Unreachable
This error occurs when Cloudflare’s servers are unable to reach the origin server, for example, because of a DNS problem.
524 A Timeout Occurred
Similar to error code 522, the 524 error is returned when Cloudflare’s servers successfully connected to the origin server but didn’t receive a timely response over HTTP.
525 SSL Handshake Failed
This HTTP status code is returned when Cloudflare’s servers could not negotiate a secure SSL/TLS connection with the origin server.
526 Invalid SSL Certificate
When Cloudflare cannot validate the SSL certificate returned by the origin server, it will return a 526 Invalid SSL Certificate status code.
527 Railgun Error
If the connection between the origin server’s Railgun server and Cloudflare’s server is lost, then Cloudflare will return this error.
If a 530 status code is returned, a 1xx informational status code will also be returned with it.
530 Site is Frozen
The Pantheon web platform returns a 530 status code to indicate that a website has been frozen because it is inactive.
529 Site is Overloaded
The Qualsys SSLLabs server testing API uses a 529 status code to indicate that the site cannot process the request because it is too busy with other requests.
Other Unofficial 5xx Status Codes
598 Network Read Timeout Error
Some proxy servers return this status code to indicate they’ve encountered a server timeout error contacting a server behind the proxy.
599 Network Connect Timeout Error
Some proxy servers return a 599 status code when they have experienced a network connection timeout when contacting another server.
How to Find Pages Returning a 5XX Server Error on Your Website
If any of your web pages are returning 5xx status codes when they should be showing content, it’s a major problem that you need to be aware of so you can fix it fast.
Not only are 5xx server errors a poor user experience, but they also don’t give Google any content to index, so pages with a 5xx server error are likely to be removed from the Google search results quickly – which is bad for your SEO performance and your traffic.
Luckily there are several ways that webmasters can stay on top of 5xx errors.
Google Search Console
Google Search Console is an invaluable resource where Google reports any problems they’ve encountered while crawling and indexing your website.
Within Search Console, you can choose Indexing > Pages from the menu to get a list of pages Google has decided not to index from your website and reasons why not.
If Google has found and de-indexed pages returning 5xx error codes when it crawls your site, then they will be shown on this report.
If you click through, you will see this screen:
This graphs your 5xx errors over time, lists the URLs of pages returning a 5xx error in the Examples section, and gives you the option to tell Google when you’ve resolved the errors so they can validate that the pages are working again and re-index them.
Search Console is a great way for webmasters to find and fix 5xx errors on their websites, and best of all, it’s completely free.
Instead of relying on Google to report 5xx errors on your website, you might prefer to search for them by using a website crawler that you control.
One of the most popular website crawlers is Screaming Frog SEO Spider.
Set Screaming Frog to crawl your website, and it will return a huge amount of information – in effect, a comprehensive technical SEO audit.
Once the crawl is complete, choose the Response Codes tab at the top of the screen, and set the filter for Server Error (5xx):
This will list all the 5xx errors that Screaming Frog found during its crawl, so you can investigate the cause of each one.
This is a good tool to use periodically to ensure your technical SEO is up to scratch, and it’s easy to keep on top of any 5xx errors as part of this housekeeping process.
Screaming Frog is a paid tool, but several free website crawlers are also available if you’re on a tight budget.
A website crawler like Screaming Frog is a great way to keep an eye on 5xx errors that your site is returning – but it only works if you remember to run it regularly.
5xx errors could appear between crawls of your website, and you might not find out until you next run a crawl.
The solution to this is to use a website monitoring service.
Most monitoring services like Pingdom.com and Uptime Robot are mainly designed to check that your website as a whole is running and accessible over the network rather than to scan for errors like 5xx errors on each individual page.
But some website monitoring services like ContentKing and others will keep track of errors being generated by any page on your website. They will be able to list any 5xx server errors they encounter.
Common Causes of 5XX Server Errors
We’ve discussed how important it is to deal with 5xx server errors on your website and how to find pages returning those error codes.
Now let’s take a look at some of the most common causes of 5xx errors to give you a head start in fixing them.
One of the most common causes of a 5xx server error is a bug in the server-side scripts in which the site is written, whether that’s PHP, ASP, or another language.
Coding bugs often return a “500 Internal Server Error” to anonymous website users because more detailed error messages would give away information on how the site is coded, which could be useful to hackers trying to break into the site.
So if you’re seeing a 500 status code, look for any recent coding changes that could explain the error.
Lack of Server Resources
A common cause of various 5xx errors is when a server is running out of resources such as disk space, memory, bandwidth, or processing power.
This often happens when your traffic spikes unexpectedly, for example, if you get mentioned by a popular social media influencer with a lot of followers.
If you find that traffic spikes are a frequent source of 5xx errors for you, talk to your hosting provider about adding capacity to your hosting plan or switching to a more “burstable” plan designed to cope with traffic spikes.
5xx server errors such as “502 Bad Gateway” and “504 Gateway Timeout” happen when a server loses connectivity to another server that it needs to fulfill the client’s request. “500 Internal Server Errors” can be caused when a web server loses connectivity to a database server.
Check the configuration of your network and the reliability of other servers on it if you’re seeing frequent 5xx errors caused by connectivity issues.
Errors in .HTACCESS File
A .htaccess file is a distributed configuration file used by Apache web servers to allow configuration of the server on a per-directory basis.
.htaccess files are very powerful, but it’s also very easy to make mistakes when editing them, and this can often leave parts of your website inaccessible, often returning a 5xx server error.
So if you’ve recently changed any of your .htaccess files, and you find some pages returning 5xx status codes, try restoring your backup of the previous .htaccess files and see if the 5xx errors go away.
Bug in WordPress Plugin or Theme
If you’re running WordPress and encounter a “5xx Server Error”, it’s not unusual to find that it’s been caused by a bug in your WordPress theme or in one of the plugins you’re running.
You may also find that two of your plugins conflict with each other, and while each would be ok in isolation, they cause problems when they’re both activated.
These problems will usually become apparent after updating your theme or plugins.
Make sure you always take a backup before updating themes and plugins in case the update causes a 5xx Server Error, so you can just restore your backup.
You may want to find out how to roll back WordPress plugins to a previous version, as this is often the quickest way to fix a 5xx error caused by a theme or plugin.
In this article, we’ve covered all aspects of 5xx Server Errors.
We started by seeing how 5xx status codes related to all the other HTTP status codes that a web server can return.
We then discussed why it’s important for SEO and for user experience to discover and fix pages returning 5xx status codes as soon as possible, preferably before search engines find them.
In the next section, we covered where to find the official list of 5xx status codes before defining and explaining all the official 5xx errors and the frequently encountered but unofficial ones too.
We then discussed how to find pages currently returning 5xx errors and how to make sure you quickly become aware of any new 5xx errors returned by your website in the future.
Finally, we looked at some of the most common causes of 5xx errors to help you diagnose and fix them quickly when you encounter them in the future.
Best of luck with keeping your website free of 5xx errors!
Further reading you might find useful: