Isn’t it annoying when you get the 504 gateway timeout error from the webpage you are trying to visit?
It is even more frustrating for site owners. They lose valuable visitors due to some pesky errors, too, without the fault of their own. Moreover, if the visitors keep on receiving the error message, they lose trust in the brand and damage their reputation.
That is why site owners must know what a 504 gateway timeout is and how they can fix it.
If you are a site owner having the 504 error on your site or want to be prepared for such a case, this guide will be helpful.
Table of Contents
- What is a 504 Gateway Timeout Error?
- How May You Receive the 504 Gateway Timeout Error?
- Causes of 504 Gateway Timeout Error
- Fixing the 504 Gateway Timeout Error
- 1. Check Your Internet Connection.
- 2. Double-Check the Website URL.
- 3. Restart Your Router and Modem.
- 4. Clear Your Browser Cache and Cookies.
- 5. Check for Your Server’s Scheduled Maintenance.
- 6. Check the Firewall Configuration.
- 7. Examine Your Server-Side Logs.
- 8. Check Your Website’s Code for Bugs.
- 9. Proxy Servers
- 10. Check Your Site’s Theme and Plugins.
- 11. Come back later.
- FAQs (Frequently Asked Questions)
What is a 504 Gateway Timeout Error?
Every time you try to visit any website, your browser sends a request to the server hosting that particular site. Then, the server responds to the request and provides the requested resources. When there is a delay in that response, you get the 504 gateway timeout error on your browser.
The 504 gateway timeout error means your web server acting as a gateway did not receive a timely response from an upstream server. Thus, your web server is unable to load the web page you are trying to reach.
In other words, your web server and the upstream server are not communicating fast enough.
Like error 503, the 504 error is also a generic error message. Such a nature makes it difficult to pinpoint the cause for the error. You know what is wrong with the website, but you don’t know why it happened.
How May You Receive the 504 Gateway Timeout Error?
There are various operating systems, web browsers, servers, and users. Also, individual sites can customize how they get the 504 timeout error. That is why you may see the 504 error in many forms. Here are some common forms you may run into:
- 504 Gateway Timeout
- HTTP 504
- 504 ERROR
- Gateway Timeout (504)
- HTTP Error 504 – Gateway Timeout
- Gateway Timeout Error
- 504 Gateway Timeout NGINX
- NGINX 504 Gateway Timeout
- Gateway Timeout Error
- Error 504
- HTTP Error 504
- HTTP 504
- This page isn’t working — Domain took too long to respond
- 504 Gateway Timeout — The server didn’t respond in time
- A blank white screen
Though the wording in the above responses is different, they all indicate the 504 error.
Causes of 504 Gateway Timeout Error
Like already said above, the 504 error is due to a connection failure between your server and the upstream server. The connection error may be due to several reasons. But whatever the reason, the server is down and is not working at the moment.
Being a network error, finding the actual cause for the 504 error is quite tricky. Your device, browser, and internet connection may be running well, and you may still face the 504 error.
Fixing the 504 Gateway Timeout Error
Here are some tricks that may resolve the 504 error:
1. Check Your Internet Connection.
The main reason for the 504 error is a delay or lack of connection between your server and the hosting server. Chances are, your internet connection may be down. Due to this, your browser might be showing the error. So, check your internet connection and assure that it is running well.
2. Double-Check the Website URL.
The 504 error also might be because you mistyped the URL of the site you are trying to visit. So, rechecking and re-typing the URL. Also, refresh the webpage a couple of times.
3. Restart Your Router and Modem.
The 504 gateway error is due to some issue with your server connection. But it is also possible that there is an issue with your router’s DNS server configuration and is causing that error. Restart your router and modem, then revisit the website.
4. Clear Your Browser Cache and Cookies.
Your browser keeps a record of the websites you visit in its cache and cookies. The idea here is to decrease the website’s loading time. However, old caches and cookies may sometimes interfere with the loading of that particular website. In such cases, you may encounter the 504 error. Clear your browser cache and reload the website. You can check out the article on How to clear browser cache for the details.
5. Check for Your Server’s Scheduled Maintenance.
Your server might be undergoing maintenance. Receiving the 504 error in such a case is standard. If you have access to your server settings, check for any scheduled maintenance. You can disable the automatic update for the settings as well.
6. Check the Firewall Configuration.
Your firewall protects your site from malicious user attacks and DDoS(Distributed Denial-of-service) attacks. If there is a faulty configuration of your firewall, it views requests from CDN (Content Delivery Network) as an attack on the server. It then blocks any request and displays the error.
You can inspect your firewall configuration and confirm the settings are correct.
7. Examine Your Server-Side Logs.
Your server-side logs give you details about the server’s hardware, its status, and health. Thoroughly inspect these server-side logs for any critical information.
8. Check Your Website’s Code for Bugs.
If your website has a bug in its code, it will not respond to the connection request from the CDN. Scan through your website’s code and look for any bugs. You can take help from the developer.
9. Proxy Servers
Server issues are a common cause for the 504 gateway error. Most of the hosting providers host the WordPress websites on Apache or Nginx servers. Those servers are waiting for response but are timing out.
Ecommerce websites and websites receiving high-traffic are more prone to this error. In such websites, the servers hosting them often overload due to multiple uncacheable requests. If you are one of those sites, the best thing you can do is upgrade to a high-tier hosting plan.
Check out our review on some of the best hosting providers.
10. Check Your Site’s Theme and Plugins.
In some cases, your WordPress theme or plugin may be causing the 504 gateway timeout error. Although, it is quite rare that a third-party app is causing such a problem. However, it does not hurt to take a look at your plugins and theme.
- Go to your WordPress dashboard.
- Scroll down the ‘Plugins’ section at the left sidebar.
- Select the ‘Deactivate’ option in the bulk action menu and click on the ‘Apply’ button.
Now, see if your site works properly. If it does then activate the plugin one by one. Don’t forget to check the site after activating each plugin. Also, make sure that your plugins and theme are up to date.
11. Come back later.
If the page is still showing a 504 error after trying all the methods, it is time to take a break. Rest assured that your device, internet, and website, and everything is working fine.
It is a problem with either your ISP or the server administrator. Contact and let them know of the issue. By this time, they are probably already working to fix it. But you might as well inform them, just in case.
FAQs (Frequently Asked Questions)
Q. Does 504 error impact the SEO?
Yes, if your site is showing a 504 error, your visitors cannot view your content. This results in an increased bounce rate and even damages the brand reputation if you don’t fix it soon. Search engines also demote your site’s ranking.
However, these cases are exceptions as the 504 error is usually temporary.
Q. How to fix the error 504?
The 504 error is mainly because of some issue with the server connection. Pinpointing the cause is quite troublesome. However, you can try the following steps:
• Refresh the website.
• Recheck the URL you are trying to visit.
• Restart your router.
• Clear the browser cache.
• Check the firewall and DNS settings.
• Check the server-side logs.
• Scan the website’s code for bugs.
Tracing the cause of the 504 gateway timeout error is quite tricky. There are many reasons why your browser is showing that error. However, the main reason is due to some fault in the server connection. Try the steps we have mentioned above and see if anything works. If not, wait it out. The 504 error is usually temporary, so have patience.
Sometime you might also face HTTP error 503. So, We recommend you to read What is HTTP error 503 and how to fix it. If you find these articles helpful then please let us know in the comment section.