NR Hosting Ltd

Cloudflare Error 504 Gateway Timeout Solution

Cloudflare Error 504 Gateway Timeout Solution

Stuck with Cloudflare error 504? 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.

What causes error 504 gateway timeout?

Some of the main causes for the Cloudflare 504 gateway timeout error is given below:

Receiving 504 from the origin web server is considered as one of the common causes of 504 gateway timeout error.

 

Cloudflare Error 504

 

504 error originating from Cloudflare end.

 

Cloudflare Error 504 2

 

The 504 gateway timeout error at Cloudflare due to large uploads

How to fix  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.
  5. Fix for 504 error originating from Cloudflare

At times error 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.

Leave a Reply

Your email address will not be published.