On this page
What this issue is
Cloudflare sits between your visitors and your origin (your hosting server). When Cloudflare cannot get a proper reply from the origin, it shows its own error page with a 52x code. The CDN is not the problem. The link between Cloudflare and your server is.
| Code | Meaning | Common cause |
|---|---|---|
| 520 | Unknown or empty response from origin | Origin crashed, sent invalid headers, or a firewall or PHP error cut the reply |
| 521 | Web server is down | Origin is offline, or it refuses Cloudflare's connections |
| 522 | Connection timed out | Origin is overloaded, or its firewall drops Cloudflare IPs |
| 523 | Origin is unreachable | Wrong origin IP in DNS, or a routing problem |
| 524 | A timeout occurred | Origin connected but took too long to answer (a slow script or query) |
| 525 | SSL handshake failed | Origin has no working SSL on port 443, or the SSL setup is incompatible |
| 526 | Invalid SSL certificate | Origin certificate is expired, self-signed or for another hostname while SSL mode is Full (strict) |
Why it costs you leads or sales
A visitor who lands on a Cloudflare error page cannot see your form, cart or booking button. Paid clicks still get charged, but no conversion can happen. Errors are often partial: one page, one form post, or only some regions, so you may not notice from the homepage.
- Ad clickVisitor clicks your ad
- Cloudflare edgeRequest reaches the CDN
- Origin serverNo valid reply (52x)
- Landing page / formNever shown
- Lead or saleNot created
The visitor reaches Cloudflare, but the origin fails, so every later step is lost.
Example: a site that normally gets 40 leads a day, on a day with a 6-hour origin error.
How to check if your site has it
Open the page in a private window
Load your landing page, form page and checkout. A Cloudflare error page shows the code and a Ray ID.
Test from the command line
Run curl -I https://yourdomain.com/ and look at the status line. Repeat for the form and checkout URLs.
Compare Cloudflare with the origin
Request the origin directly, for example curl -I -k --resolve yourdomain.com:443:ORIGIN_IP https://yourdomain.com/. If this fails too, the fault is on the server.
Check Cloudflare analytics
In the Cloudflare dashboard, open Analytics and look at the 5xx error rate, grouped by status code, for the time of the problem.
Read origin logs
Check your web server error log and PHP or application log for crashes, timeouts and blocked requests at the same time.
curl -I -k --resolve yourdomain.com:443:203.0.113.10 https://yourdomain.com/How to fix it
Start with the code, because each one points to a different layer. Then use the platform notes if your host or builder limits what you can change.
520: find why the origin returns nothing
Check origin logs for crashes, PHP fatal errors, oversized response headers or a firewall resetting the connection. Fix the application error, then retest.
521 and 522: let Cloudflare reach the origin
Make sure the server is running and listening on ports 80 and 443. Allow Cloudflare's published IP ranges in the server firewall, security plugin, and any host-level rate limiting. Reduce load if the server is overloaded.
523: correct the origin address
In Cloudflare DNS, confirm the A or AAAA record for the proxied hostname points to the current origin IP. Update it after any host migration.
524: speed up the slow request
Find the slow script, query or API call and optimise it. Move long jobs (imports, exports, reports) to background tasks so the request returns quickly.
525 and 526: repair origin SSL
Install a valid certificate on the origin that covers the hostname and has not expired. A free Cloudflare Origin CA certificate works with Full (strict). Then set SSL/TLS mode to Full (strict) under SSL/TLS > Overview.
Check PHP errors and plugins
Turn on WP_DEBUG_LOG, read wp-content/debug.log, and disable recently updated plugins to find a crash (520) or slow request (524).
Check security plugins
In Wordfence or similar, make sure Cloudflare IPs are not rate limited or blocked (521, 522).
Ask your host about SSL
For 525 and 526, install or renew the certificate in your hosting control panel.
Check how Cloudflare is connected
Shopify hosts the origin and manages its certificates. If you proxy a Shopify domain through Cloudflare and see 52x errors, check that DNS records match Shopify's instructions and consider turning the proxy off (grey cloud) for that record, then contact Shopify support.
Check DNS and proxy settings
Webflow hosts the origin. Use the DNS records Webflow gives you, and if 52x errors appear behind a Cloudflare proxy, set the record to DNS only (grey cloud) and contact Webflow support if it continues.
Check the web server
Confirm nginx or Apache is running, listening on 443, and has a valid certificate with the full chain.
Raise limits only where needed
Review worker counts, timeouts and database performance before raising proxy timeouts.
How to confirm it's fixed
- Landing page, form page and checkout return 200 through Cloudflare
- The direct origin test also succeeds
- Cloudflare analytics show the 5xx rate back to normal
- A test form submission completes and the lead arrives
- Checks from more than one region pass
How to prevent it happening again
- Set certificate renewal to automatic and check expiry dates
- Keep Cloudflare IP ranges allowed in every firewall layer
- Update the origin IP in DNS whenever you change hosts
- Watch server CPU, memory and database load
- Test key journeys after every deploy or plugin update
- Monitor the full journey on a schedule, not just the homepage
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your real customer journeys on a schedule, from the EU or the US, and checks each step. If a page returns a Cloudflare 52x error instead of your site, the step fails. The failure is re-checked from a second region, then one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Frequency depends on your plan: the Free plan runs daily checks on 1 site and 2 journeys, and paid plans start with a 3-day free trial.
Questions people ask
What does Cloudflare error 520 mean?
Error 520 means the origin server sent an empty, unknown or invalid response to Cloudflare. Check your server error logs for crashes, PHP fatal errors, oversized headers or a firewall resetting the connection.
Why am I getting Cloudflare error 522 connection timed out?
Cloudflare could not open a connection to your origin in time. Usual causes are an overloaded server, a server that is offline, or a firewall that drops Cloudflare's IP addresses. Allow Cloudflare IP ranges and check server load.
How do I fix Cloudflare error 521 web server is down?
Confirm your web server is running and listening on ports 80 and 443. Then check that no firewall or security plugin blocks Cloudflare IPs, and that the origin IP in Cloudflare DNS is correct.
What causes Cloudflare error 524 a timeout occurred?
The origin accepted the connection but did not reply in time. This is usually a slow script, database query or external API call. Optimise it or move long tasks to the background.
How do I fix Cloudflare 525 and 526 SSL errors?
Install a valid, unexpired certificate on your origin that covers your hostname, then use SSL/TLS mode Full (strict). A Cloudflare Origin CA certificate is a free option for the origin link.
Is a Cloudflare 52x error my site's fault or Cloudflare's?
Usually the origin or its connection to Cloudflare. Test the origin directly with curl and --resolve. If it fails, the fault is on your server or host.
How can I know when my site shows Cloudflare errors?
Use monitoring that loads your real pages on a schedule. FunnelGuard runs your journeys from the EU or US, re-checks failures from a second region and sends one alert with a screenshot.
Related issues
- OPS-114CDN SSL mode Flexible causing loopsFix guide
- OPS-115CDN purges failing / edge outageFix guide
- OPS-100Cloudflare/WAF blocks real visitors (challenge loops)Fix guide
- OPS-122Allow-list missing for monitoring IPs (false blocks)Fix guide
- OPS-107CDN serving stale page after deployFix guide
- OPS-120Firewall blocking webhook callbacks (Stripe, CRM)Fix guide