A 524 error indicates that Cloudflare successfully established a TCP connection with the origin web server, but the origin server did not send an HTTP response before the default 100-second timeout expired.
Unlike a 522 error (where the server never answers the initial connection), a 524 error means the server answered the connection, received the request, and then spent more than 100 seconds computing the answer without transmitting data back.
Common cause
- A long-running database query, data export, or complex report generation.
- The origin web server is suffering extreme CPU or memory overload.
- An external API call made by the origin server is hanging.
Steps you could possibly take:
If you are a visitor:
- Avoid repeatedly refreshing the page, as this triggers new slow database queries on the origin server.
- Try again at a later time when server load is lower.
If you are the website owner:
- Optimize slow backend code - Profile your database queries and application execution time to reduce processing duration below 100 seconds.
- Move long tasks to background workers - For large file exports, reports, or data imports, use asynchronous job queues (like Celery, Bull, or Redis queues) and return an immediate status URL.
- Use Enterprise plan or gray-cloud subdomain - If a specific administrative task genuinely requires >100 seconds, execute it on an unproxied subdomain (DNS only, gray cloud) or upgrade to Cloudflare Enterprise where timeouts can be adjusted up to 6,000 seconds.
Source: Cloudflare Documentation - Troubleshooting Cloudflare 5XX errors (Error 524)