Troubleshooting 504 Gateway Timeout


The purpose of this troubleshooting procedure is to troubleshoot 504 Gateway Timeout errors. A 504 Gateway Timeout indicates that a timely response was not received from a web server.

Requesting Content from a Web Server

Try to narrow down the source of this error by requesting content directly from your web servers. A response code other than 200 OK may be indicative of a non-CDN related issue.

A firewall may prevent requests from being served directly from a web server.

Point a request directly to a web server by replacing the URL segments highlighted below with a hostname or IP address defined in the Hostname Configuration section of a customer origin configuration.




Point the request generating a 504 Gateway Timeout to a hostname/IP address defined in the corresponding customer origin configuration.


Find out whether this issue is specific to a particular location. Location-specific issues are indicative of broader network issues.


Check whether user complaints are restricted to a single region.


Which of the following best describes the conditions under which this status code is returned for a particular customer origin?

  • All requests
  • Intermittent requests
  • A single request
  • A single time period


Find out the frequency at which this error occurs.

Load Balancer

A load balancer in front of a set of web servers may cause this issue to occur intermittently. This scenario is indicative of an issue with a specific web server within the load balancing scheme. This status code is only generated for traffic that is load balanced to that web server.


Check whether a load balancer is in front of your web servers.