Visitors: wait and retry. Site owners: find the slow request in your logs, optimise it, move long jobs to background workers, or serve long operations from a subdomain not proxied by Cloudflare.
What Error 524 actually means
Unlike 522 (no connection) a 524 means the connection succeeded, but the origin worked too long on the request. Large exports, slow database queries and heavy admin actions are typical triggers.
How it shows up
- Cloudflare page: “Error 524. A timeout occurred”.
Why Error 524 happens
- Long-running scripts or database queries.
- Overloaded origin server.
How to fix it, step by step
- VisitorsRetry later; avoid repeatedly submitting forms.
- Find the slow endpointCheck origin logs and APM for requests over 100 seconds.
- Optimise or offloadAdd indexes, caching, or background job queues with status polling.
- Bypass for admin tasksUse a DNS-only (grey-cloud) subdomain for long admin operations.
Check it's fixed: Requests complete within the timeout and the 524 page stops appearing.
Keeping it from coming back
Keep request times short and monitor slow endpoints.
