If you’ve ever visited a website and gave you an error page, you know how frustrating that is.
One of the worst things you can do as a brand is fail to meet your audience’s needs and expectations. If your website visitors see an error page while looking for help or information, they could become frustrated and lose trust in your brand, permanently damaging your reputation.
The 504 gateway timeout error is a type of error that can affect the user experience in this way. To keep you from losing brand sentiment and consumer confidence, we’ve worked out exactly what this mistake means and what are its most common causes and solutions.
What is a 504 gateway timeout error?
A 504 gateway timeout error means that your web server did not receive a timely response from another upstream server when it attempted to load one of your web pages. Put simply, your web servers are not communicating with each other quickly enough. Because a 504 gateway timeout error is rather general, it cannot determine the exact cause of the problem. In this case, your website will provide an error page to your website visitors.
Here’s how a 504 gateway timeout error can appear in your user’s browser:
504 Error in wording
The screenshot above shows how a 504 gateway timeout error occurs on a server. Below are some other common ways that a 504 error can occur depending on the server, operating system, or browser you are using.
- In Google Chrome, a 504 error is displayed as HTTP ERROR 504. This code will appear under a message that says something like, “This website cannot be reached. _____ took too long to answer. “
Image source
- In Windows-based programs, a 504 error is displayed as ERROR 504, HTTP_STATUS_GATEWAY_TIMEOUT, or “Request timed out while waiting for a gateway message”. It can look like this when using Excel:
Image source
- During a Windows update, a gateway timeout error generates a 0x80244023 error code. The message is: WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT.
Image source
- In other operating systems, web servers or browsers, a 504 error can also lead to the following message – although it is less common: “The proxy server did not receive a timely response from the upstream server.” Here is a small variation:
Image source
So now we know how the 504 error is worded – but what does it mean exactly? Let’s decode it below.
What does 504 gateway timeout mean?
When you visit a website, your server sends a request to another server that hosts that website. This server – known as the “upstream server” – receives the request and replies with all the resources needed to load the website in your browser.
However, a 504 gateway timeout error means that your server did not receive a sufficiently fast response from the upstream server. Due to the request timed out, your server cannot load the web page and ultimately fulfills its role as a gateway – hence the name “Gateway Timeout” error.
You might be wondering what exactly is causing the delay in the upstream server’s response – and that’s a good question. Let’s address it below.
504 Gateway timeout causes
504 gateway timeout errors are among the most frustrating HTTP status codes you can get. They state what happened to your website, but they don’t tell you why it happened, which makes it difficult for you to determine the cause and ultimately fix the problem.
Below are a couple of options.
Server connectivity issues
Most websites live on multiple servers or third party hosting providers. If your server is down due to maintenance or any other reason, your website could present visitors with a 504 gateway timeout error page.
DNS changes
If you recently changed servers or moved your website to a different IP address, changes will be made to your website’s DNS server. This could result in your website showing a 504 gateway timeout error page to its visitors. Your website will not be operational until these DNS changes take full effect, which can take a few hours.
Incorrect firewall configurations
Your firewall is the gatekeeper of your website and protects your website from malicious visitors or DDoS attacks (Distributed Denial-of-Service). Sometimes an incorrect firewall configuration causes your firewall to view requests from a content delivery network as an attack on your server and reject them, resulting in a 504 gateway timeout error.
Error in your website code
If your website code is incorrect, your server may not be able to correctly respond to requests from a content delivery network.
Network connection error
Since a 504 error is the result of a timeout while processing a request between servers, the problem is likely with them – not with the internet connection or the user’s device. However, if only one user reports that their site is showing a 504 error, it could be due to their modem, router, or some other device. or your internet connection.
Since there are multiple reasons for a 504 error to occur, it is ultimately up to you to rule out each one until you find the real cause. Fortunately, there are five common and effective solutions to addressing most of the causes of 504 Gateway Timeout Errors.
How to fix 504 gateway timeout error
- Check for server connectivity issues.
- Check for DNS changes.
- Search your logs.
- Correct incorrect firewall configurations.
- Search your website code to find bugs.
- Contact your hosting provider.
1. Check for server connectivity issues.
If your server is down due to maintenance or any other reason, your website will likely show visitors a 504 gateway timeout error page. The only way to fix this problem is to wait for your server to finish servicing or for the problem that caused the error to be resolved.
2. Check for DNS changes.
If you recently changed hosting provider or moved your website to a different IP address, your website’s DNS server will need to be updated. These DNS changes take a few hours to process, so in the meantime, your website may show visitors a 504 gateway timeout error page. The only solution is to sit still while these DNS changes take effect.
3. Search your logs.
If the problem isn’t your server’s connection or DNS information, check your server logs. These logs provide details about the health and status of your server. Browsing can reveal other problems that could be causing a 504 error.
4. Correct incorrect firewall configurations.
A faulty firewall configuration can be the reason for your 504 Gateway Timeout Error. to as a cause you can temporarily exclude disable your firewall.
If your device is running Windows, navigate to your Control Panel and click Update & security > Windows security > Virus and threat protection > Manage settings. You can deactivate your firewall on this settings page.
If your device is Mac OS, just navigate to System settings > security > Firewall to disable it.
After disabling your firewall, check to see if the 504 error is resolved. If so, you can either reconfigure the settings of your existing antivirus or switch to a new one.
If the error is not resolved, do not forget to reactivate your firewall before proceeding to the next step.
5. Search your website code for bugs.
Search your code for bugs or copy and paste your code into a development computer. It does a thorough debug process that simulates the situation where your 504 gateway timeout error occurred and allows you to see the exact moment when something went wrong.
6. Contact your hosting provider.
Contacting your hosting provider should be your last resort. However, if you’ve followed the steps above and you are still seeing the 504 Gateway Timeout error, they may be able to solve the problem or provide valuable insight.
How 504 Gateway Timeout Errors Affect SEO
Fixing a 504 gateway timeout error can take some time – but it’s worth it considering how it can affect your website’s technical SEO.
As with an internal HTTP 500 server error, 503 error, or any other 5xx error, a 504 gateway timeout error will prevent your website from loading. This not only harms the user experience but also your SEO performance.
If a web crawler tries to crawl one of your pages and receives a 504 error, it will not be able to crawl the page. If this page has already been indexed, it may be lowered in search engine results. Or it may be de-indexed if the error persists.
Fixing the 504 gateway timeout error
There is no foolproof way to prevent 504 gateway timeout errors from occurring on your site, but there are steps you can take to resolve them. By fixing this error as soon as possible, you will ensure that visitors continue to experience your website seamlessly and reduce the negative impact on your SEO.
Editor’s note: This post was originally published in January 2019 and has been updated for completeness.