Outage Status Now

Guides / Cloudflare Error 521 / 522 / 5xx: what site owners should check

Part of: Network, VPN and 'is it just me?' problems

Last reviewed · By

Cloudflare Error 521 / 522 / 5xx: what site owners should check

Cloudflare 521, 522 or 5xx on your site? Tell origin down, firewall blocks and SSL mode mistakes from a Cloudflare edge incident.

Visitors see a Cloudflare-branded page: Error 521 Web server is down, Error 522 Connection timed out, 523, 524, or a generic 5xx. Non-technical stakeholders forward a screenshot and say "Cloudflare is down". For those codes, Cloudflare's edge usually is up — it is telling you the hop to your origin failed. Treat it like an origin ticket first.

Is it Cloudflare or your origin?

Check the Cloudflare status page. Then hit the origin hostname or IP directly (hosts file or curl to the origin address, bypassing the proxy) and compare with the proxied hostname. If origin fails directly, fix the server or upstream cloud. If origin answers locally but the proxied name returns 521/522, look at firewall allowlists, SSL mode, and whether the record is correctly proxied.

What the common codes mean

Owner checklist (ordered)

  1. Confirm the DNS record. Orange-cloud proxied A/AAAA/CNAME must point at the current origin. A stale IP after a host migration is the classic 522.
  2. Is the web service up? On the origin: process listening, container healthy, load balancer target healthy. Hosting panel "site stopped" counts.
  3. Allow Cloudflare IP ranges. Origin firewalls, security groups (AWS/Azure/GCP), and panel "block all but my office" rules that forgot Cloudflare's published ranges cause 521/522 only on the proxied path.
  4. SSL/TLS mode. Flexible against an origin that redirects HTTP→HTTPS loops badly; Full (strict) needs a valid certificate on the origin. Wrong mode produces 525/526 and weird 5xx redirects.
  5. Authenticated Origin Pulls / mTLS — if enabled, origin must trust Cloudflare's client cert or you get refusals that look like 521.
  6. Rate limiting and WAF on origin separately from Cloudflare — some hosts ban Cloudflare anycast ranges after traffic spikes.
  7. Workers / routes / Page Rules recently changed — a Worker exception can surface as 5xx independently of origin health.

Hosting-specific notes

What to tell stakeholders

Either: "Cloudflare's edge is up; it cannot reach our server — we are fixing origin/firewall" or "Cloudflare has posted an edge incident affecting our PoPs — visitors may see errors until they clear it". Mixing those sentences creates duplicate bridges and angry CEOs.

When to escalate

Escalate to Cloudflare when origins answer cleanly from multiple networks, firewalls allow published Cloudflare ranges, SSL mode is correct, and only proxied traffic fails across regions — especially if status.cloudflare.com names an edge or DNS incident. Include ray IDs, UTC times, zone name, and origin IPs. A single origin process crash is your pager, not theirs.

Related status pages

Related guides

FAQ

What is Cloudflare Error 521?
Cloudflare connected to your origin IP but the web server refused the connection. Usually the origin service is down, not listening on the right port, or a firewall is resetting Cloudflare.
What is Cloudflare Error 522?
Cloudflare timed out connecting to your origin. Typical causes are a wrong DNS IP, origin host down, or a firewall dropping Cloudflare traffic.
Does a 521 mean Cloudflare is down?
Usually no. The Cloudflare error page means their edge responded and could not get a good origin connection. Check origin health and Cloudflare status to be sure.
How do I bypass Cloudflare to test the origin?
Curl the origin IP with the correct Host header, or use a hosts file entry pointing the hostname at the origin. Compare that result with the proxied public hostname.

Did this help?

Still broken? Check another tool