The error 504 gateway timeout is a common error faced by website owners and visitors. However, for the website owner with a WordPress website or an eCommerce website, knowing how to fix it is crucial. The competitor site may take their customer away in a delay of a few seconds.
So, in this guide, you will learn what is 504 gateway timeout, how it occurs, its effect on SEO and solution in a detailed manner.
All error codes starting with 5xx are the errors from the server-side. Here, the 504 gateway timeout error is in the HTTP status code. It refers to a time delay in response from one server to another server (gateway or proxy).
To understand how the gateway timeout error appears, you need to go through its working first. You need to understand how a website responds when you ask for it.
However, not all HTTP codes are bad for instance, status code 200 indicates that everything is alright.
One of the main causes is the delay in response from the gateway. Besides that, there are other reasons that cause the 504 gateway timeout error to occur.
The error can appear in various forms and it’s because different operating systems display different messages. So, you don’t get confused, we have listed the possible forms of 504 error.
All of the error messages mentioned above may be worded differently but indicate the same problem.
Webmasters and web servers have the option to customize the appearance of the error 504. Some of the websites become creative to quell the visitor’s disappointment.
Although, it is a common error yet the impact can be detrimental to a website. It can have a grave impact on search engine optimization. That is why search engines like Google and Firefox take this error seriously and take rapid action.
Let’s understand here.
For an error 503, google understands that the service is unavailable temporarily. Hence, it will try again to crawl the page later. But in the case of 504, the concept is very different.
In the case of a 504 gateway error, it may not be a temporary error. It can linger on for a long time which may affect a website’s growth.
For any website that is unavailable or has a 504 error for a long time, say 6+ hrs then, Google will take it seriously. You need to fix the gateway timeout error, as soon as possible or the web pages may get de-indexed from the search engine results.
Now, let’s move to the next section where we will discuss the possible fixes for the gateway error.
No matter how cool the webmasters make the gateway error 504 appear, it is still annoying. After all, you are visiting the website for some reason and not to meet some cartoon character.
So, let’s discuss the fixes in the simplest and most effective manner.
Sometimes, the network connection is the real culprit behind the timeout gateway error. Hence, you can try restarting your device and the network connection as well.
If this method is unable to resolve your issue, move to the next solution.
More often, a page after refreshing or reloading gets back on the severe. Likewise, without getting panicked, you should try the method first.
ProTips and tools
You can check if the site is down only at your end or is down for others also.
For that, copy-paste the link:
Now that you have tested the visibility of a website online for others, try this method.
Try accessing the website in Incognito mode. Or, use a browser other than the one causing trouble for you. It can help you determine if the problem is with the browser or website.
Like the previous method, try accessing the same website on different devices with different networks. This step will help you figure out where the problem is- on the server-side or it is local.
If you are using a proxy network, minor but the chance is that it may cause the 504 gateway timeout.
A proxy server acts between you and the client-server. It creates a secure network for your IP address by hiding the reallocation.
Although the possibility is almost null (especially on the client-side) yet you can try to disable it. Incorrect proxy server settings may be the reason. Once disable it and try reloading the page.
Often, the HTTP error 504 is caused by the DNS server. The problem can have roofing from any of the slides, the severe side or the client-side. Let’s understand each side’s problem.
The main reason for the gateway error can be due to a fully qualified domain name (FQDN). That is FQDN does not resolve the correct IP address or the DNS server is being unresponsive.
The possible activity of its unresponsiveness is the changed host server. Suppose, if you have just shifted your current WordPress site to another hosting server, you need to wait. Usually, one has to wait up to 24 hours until the DNS records propagate fully.
In this case, you have to clear or flush the DNS cache. It’s nothing different from clearing the caches in a browser. The only difference is the tag line that is “flushing the DNS cache” here.
If you have windows:
you can clear the caches directly from the command prompt.
On Mac/Linux:
You can only change the DNS server temporarily as the DNS server is provided by your ISP. further you can also try public severe to change DNS temporarily; Google’s public DNS, Quad9 DNS, and Cisco OpenDNS.
Another reason that the HTTP error 504 occurs is due to the content delivery network. It’s because when a site’s origin server is not reachable, most CDN’s will try to provide full web pages stored in the cache.
Hence, in the case of third-party CDN, you can disable it temporarily. For instance, if you are accessing a free CDN enabler WordPress plugin to link your site’s asset to CDN URL, disable it temporarily.
Further, the same can be performed in other plugins like WP Rocket, Breeze, or W3 Total Cache. Or, if you don’t have site plugin access, then rename the plugin folder.
Using Cloudflare:
If you are using Cloudflare then you can’t actually lame it. Instead, you need to identify the error type first.
Case 1: If you see a page almost black with a few words “504 Gateway Timeout”, the issue is from Cloudflare’s side. Contact their customer support or check their status page. However, in such a case, the engineers are aware of the issue and often work on it.
Case 2: If the page reflects proper working from the Cloudflare side then the issue is with the hosting side. In this case, move to the recommendations mentioned below.
The major reason for the occurrence of gateway error 504 is related to the server. Though several WordPress websites are hosted on the Nginx or Apache web servers, the issue came up. While Nginx or apache is waiting for a response from another server and times out, the issue occurs.
If you notice, the 504 error is very popular on eCommerce sites and online stores. It’s because the visitors are in high numbers however, the latter may have installed eCommerce plugins like Woocomerce.
Such sites witness several non-cache requests which further can overload the server. This is a common issue that may appear even on a simple website like blogs.
For that, many hostings recommended upgrading to a more expensive tariff plan. A plan that caters to the need, is a good option. Yet, it is not necessary for everyone to buy an expensive tariff plan.
Note that many hosting offer resources dedicated to each severe. That means each site is hosted in its isolated container. Here, resources are kept confidential and have the potential to run it. Nonetheless, there are various shared WordPress hosting providers, which do not have this feature. Hence, any neighboring site with high traffic will show a gateway timeout error.
To escape such errors in the future, you can take the help of a tool ‘statuscake.com’.
Such a service is useful in the case of virtual hosting. Where it will cite the reason and time of the site of not working and suggest too you move on to dedicated hosting.
If none of the above is the issue then malicious attacks or spamming is what is causing the error. It so happens that your site has been DDoS attacked or spammed by bots. This, as result, can lead to uncache requests and eventually overload the server. Which then will cause an error 504.
Note that, the number of requests matters for any site to perform better and gain stability. Although, it is not always possible. Because some resources like Woocommecere generate a number of uncached requests.
With these reports, you can also identify which traffic or IP address are to be blocked. For that, you can use WordPress security plugins.
However, the same does not apply to all hosting servers. Because many don’t allow as the plugins can:
Nonetheless, blocking unwanted traffic or Ip addresses may not always help. When the attack/spam is blocked in one area, it finds another zone by changing its IP address or proxy. Hence, to escape the issue in the long term, we recommend you install a robust security solution such as Cloudflare or Sucuri.
Well, many users believe that plugins and themes do not clog the server with gateway error 504. In many cases, it goes right as worded.
However, the situation keeps changing and many users have the opposite experience. According to them, a slow non-cached plugin request may also cause delays. Why? Well, it’s because it would need to use more PHP workers as mentioned above.
What happens here is that your old requests are deleted when you reach the limit of request. Apparently, an error 504 appears usually confused with error 502. The error 502 refers to time out of 60 seconds.
To fix the issue:
1. Deactivate all your plugins with the admin panel: you will not lose any data. So to disable the plugins login to the admin panel >> Plugin section >> select Deactivate.
2. Deactivate all your plugins without an admin panel: in case you don’t have admin access, use the FTP client to connect to your server.
Before you apply this method, ensure you have the latest version of plugins, themes, and the WordPress kernel.
Error logs can help you in troubleshooting and debugging the error 504 on your WordPress website. It can help in filtering out the issues on your site rapidly, especially when born out of the demanding plugin.
You can see the error logs of the hosting dashboard. However, if it doesn’t provide the data, use the following codes:
To find the logs, you can visit :
This method is useful for those who maintain their server and WordPress website. Tweak the settings to eliminate the gateway error 504.
Case 1: using Nginx with FastCGI (php-fpm)
Set directives as mentioned below:
Location ~ .php
${
Fastcgi_read_timeout 300;
}
Further, if you’re using Nginx as a server for Apache then you may need to tweak the additional settings to eliminate the gateway error 504.
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
service nginx reload;
If the error 504 gateway timeout is repeating after performing all methods above, contact the hosting technical support. Typically, it’s an issue related to the server, but it can also be caused by third-party plugins or the queue/backlog overflow of your PHP worker. If you are still confused or have more queries, you contact our WordPress Support experts.
Tagged with: 504 error 504 gateway timeout 504 gateway timeout error gateway error 504 gateway timeout error http error 504 what is 504 gateway timeout
On Time Delivery
Discount
24×7 WordPress Support
Cost Effective Services
Skills Wordpress Developers
100% Satisfaction