Cloudflare error 524: A Timeout Occurred

Cloudflare connected to the website’s server, but it took too long to send a response. This is an unofficial code used by Cloudflare. You won’t find it in the HTTP standard.

A Timeout Occurred

5xx Server errorUnofficial: CloudflareCloudflare docs: error 524

Cloudflare connected to the website’s server, but it took too long to send a response.

Example response
HTTP/2 524
server: cloudflare
cf-ray: 8f1c2a3b4d5e6f74-LHR
content-type: text/html; charset=UTF-8

<!DOCTYPE html>… Error 524: A timeout occurred …

What 524 means

Unofficial, used by Cloudflare. Cloudflare connected to the website’s own server, but the server didn’t send an HTTP response before Cloudflare’s timeout. At the time of writing, Cloudflare’s docs give a default of 125 seconds.

When servers send it

For slow requests: big reports, exports, slow database queries, or an overloaded server.

Common causes

  • A long-running request such as a large export or query.
  • An overloaded origin server.
  • A request waiting on a slow third-party service.

How to fix it as a developer

  • Make slow requests faster, or move them to a background job and poll for the result (return 202 Accepted).
  • Send long-running exports through a DNS-only (grey cloud) subdomain.
  • Enterprise plans can raise the timeout. Other plans can’t.

How to fix it as a visitor

  • Try again later. What you asked for may still be being processed, so don’t repeat a payment or order without checking first.

Related codes

  • 504 Gateway Timeout: A proxy or load balancer gave up waiting for the server behind it to reply.
  • 522 Connection Timed Out: Cloudflare couldn’t connect to the website’s server in time.
  • 202 Accepted: The request has been accepted for processing later, but it hasn’t been done yet.
  • 408 Request Timeout: The server gave up waiting for the client to finish sending its request.

Where it’s defined

524 isn’t in any RFC or the IANA status code registry. It’s used by Cloudflare. Reference: Cloudflare docs: error 524.

Other 5xx codes

500 Internal Server Error · 501 Not Implemented · 502 Bad Gateway · 503 Service Unavailable · 504 Gateway Timeout · 505 HTTP Version Not Supported · 511 Network Authentication Required · 520 Web Server Returned an Unknown Error · 521 Web Server Is Down · 522 Connection Timed Out · 523 Origin Is Unreachable · 525 SSL Handshake Failed · 526 Invalid SSL Certificate

Or search them all in the HTTP status code list.

Questions people ask

What does HTTP 524 A Timeout Occurred mean?
Cloudflare connected to the website’s server, but it took too long to send a response. It’s an unofficial code used by Cloudflare, not part of the HTTP standard.
How long is Cloudflare’s 524 timeout?
Cloudflare’s documentation gives a default of 125 seconds, which Enterprise customers can raise. Check their docs for the current figure.
Did my request still run after a 524?
Possibly. Cloudflare stopped waiting, but the origin may have finished the work. Check before retrying anything that changes data.
↑↓ move↵ openesc close