It’s both worrisome and frustrating when you are trying to browse a WordPress website and keep encountering errors. Some of the commonest problems you may have encountered would be 502 – bad gateway or the popular white screen of death. Let’s not forget the ever so popular, error in establishing a connection.
For a regular website, these errors may not have major repercussions. But, for news/blog and e-commerce sites, these errors can cause major loss in terms of revenue.
In this post, we will talk about 504 gateway timeout error, what causes it, and some ways to fix it.
What is 504 error in WordPress
Before we talk about this error in detail, it’s crucial that we understand how it gets generated in the first place. The thing is, whenever a browser is launched and a user visits a website, a request is sent back to the server on which it is hosted.
That server would then process the request and send back the requested resource along with HTTP header. HTTP header carries several HTTP status codes which tell whether or not everything is alright. But, not all the statuses are bad. A 200 status code for example means ‘Everything is Alright’.
When you talk about 500 status error codes such as (500, 502, 503, etc.) – all of them have different meanings. The codes indicate that the error was accepted but the server could not process the request.
504 – gateway timeout means ‘the server which was acting like a gateway timed out while waiting for some other server to give a response’. This error happens in cases when there are 2 servers processing a request and the first server waited for the upstream server to respond but the response was never received during a certain duration.
Variations of 504 Gateway Timeout Error
Since there are countless operating systems, web browsers, and servers, you may see several variations of 504 gateway error. But, all of those errors mean one and the same thing.
Take a look at some of the common variations you may come across –
- 504 Gateway Timeout
- Gateway Timeout Error
- 504 Error
- HTTP error 504
- Error 504
- HTTP 504
- Gateway Timeout (504)
- A blank white screen
- “504 Gateway Time-out – server didn’t respond in time”
- “NGINX 504 Gateway Timeout”
The most common cause of this error is when the server is not properly functioning or is down due to connectivity issues.
Let’s take a look at some of the reasons that might be causing this error –
- Browser errors – Sometimes the settings of a web client (browser for example) may not be configured properly. In that case, connectivity issues may be experienced.
- Network connectivity – Poor network connectivity between web server and proxy may also cause delays in getting HTTP response request.
- DNS Issues – Improper DNS domain settings can cause domain resolution issues resulting in timeout error when trying to access a site.
- Firewall blocks – Sometimes the firewall configurations of the web server could have certain errors which can come in the way of connection getting established properly thus causing several errors.
- Slow server – Sometimes the server on the backend, like Apache for example could be too slow thus failing to fulfill the request. The reason behind this slow performance can be too much traffic. Again, this issue can cause the 504 error.
- Proxy Server Timeout – If the timeout duration of the proxy server is too short, HTTP requests may not get proper time to be received, processed and passed to the client.
Ways to fix 504 error
The error is indicative of the fact that the proxy server could not receive a response from web server within a specified time period. But, before you go ahead and fix the problem, it’s important to understand the cause of error first.
For that you need to know whether the issue is arising from server side or client side.
Following steps will confirm that the issue is client-end.
- By loading the site in other server and see if the issue is fixed
- By checking the local firewall and ISP issues
- Trying to access the URL from different location
- Refreshing the app/website
- Making sure that the proxy server settings are correct in the app/browser
- By turn on and off the network device
The steps above should confirm if the issue is arising at the client side. If that’s the case, check out this really helpful guide listing out ways to fix 504 gateway timeout.
However, if that’s not the cause, there might be some issue with the server-end, then you would need to check the error logs in web server. From there you can get insight into what may be causing the timeout error.
Take a look at some of the tasks you can perform to fix the the 504 error –
- Examine the DMS settings related to the site and see if there are any resolutions errors that need fixing.
- Detect network connectivity issues with network tools like traceroute and fix the.
- Contact the hosting service provider and they may bring the server to a stable state in case it is loaded with too many requests and is facing high traffic.
- Slow web servers would need parameter tweaking and server optimization in order to improve the speed.
- Hosting company would need to audit the firewall of their server and check if there are any unnecessary blocks that might be coming in the way of the connections.
504 timeout is a common error that users runs into every now and then. If you are a website user, there are several steps you can implement to fix the issue.
But, if the issue is not arising at your end, we recommend getting in touch with tech support of your hosting company.