Stuck with Cloudflare error 504? We can help you.
Cloudflare error 504 gateway timeout occurs when Cloudflare is unable to establish a connection with the origin web server.
This happens when Cloudflare requests a web page and gets blocked by the site’s web server or firewall or load balancer, resulting in the request timeout.
It can also occur if we change the IP address of the origin web server and did not update the same in the Cloudflare portal.
Here at Bobcares, we often fix this error for our customers as a part of our Server Management Services.
Today, let’s see how our Support Engineers fix this Cloudflare error for our customers.
What causes error 504 gateway timeout?
Some of the main causes for the Cloudflare 504 gateway timeout error is given below:
1. Receiving 504 from the origin web server is considered as one of the common causes of 504 gateway timeout error.
2. 504 error originating from Cloudflare end.
3. The 504 gateway timeout error at Cloudflare due to large uploads
How to fix Cloudflare error 504 gateway timeout
We will see how our Support engineers troubleshoot and fix Cloudflare 504 gateway timeout error for the above-mentioned causes.
1. Fix for Receiving 504 from the origin web server
We will ensure the below aspects at the webserver:
1. First we will check whether the IP address is correctly set for the domain in the Cloudflare portal.
2. Then we have to ensure that the server firewall is not blocking any connections from Cloudflare. We can whitelist the Cloudflare IP addresses if they are not among the whitelisted IPs on the server.
3. High load on the server can also lead to timeout issues and website errors. So we will check whether there are any applications running with high CPU usage, or if any website traffic is there on the webserver.
4. Finally we will check if the web-server (httpd, apache, nginx) and Mysql services are properly running in the server by checking their status.
2. Fix for 504 error originating from Cloudflare
At times error 504 will be arising from Cloudflare’s end. In this case, Cloudflare will be already aware of the issue and working on it.
However, we will confirm this by checking “https://www.cloudflarestatus.com/.” for the Cloudflare System Status.
For avoiding delays in processing the inquiry request we can provide the following details pro-actively to the Cloudflare Support:
1. The exact time and timezone when the issue occurred
2. URL that resulted in the HTTP 504 error as a response.
3. Fix for 504 Gateway Timeout at Cloudflare Due to Large Uploads
The reason for this is the size of the uploads to the site being too large causing server timeouts.
Cloudflare limits upload file size (per HTTP POST request) to 100 MB for both Free and Pro plans.
This issue can be either on the host’s end or Cloudflare’s end. To find this out we will bypass Cloudflare with the DNS hosts file and try to upload again.
[Still, facing error? We are happy to help you!]
To conclude, we saw some of the common causes for the 504 error. Also, we saw how our Support Engineers troubleshoot and fix Cloudflare 504 gateway timeout error.