When a website sits behind Cloudflare, outages show up as numbered error screens — 521, 522, 523, 524 — instead of normal HTTP errors. These codes tell you exactly where the chain is broken. Here's how to read them and what you can do.

How Cloudflare sits between you and the site

Cloudflare is a reverse proxy: your browser talks to Cloudflare, and Cloudflare talks to the website's origin server. Every Cloudflare error means "Cloudflare is fine, but something between me and the origin is broken."

The four codes, decoded

  • 521 — Web server is down. The origin actively refused Cloudflare's connection. The site's server is off or blocking Cloudflare.
  • 522 — Connection timed out. Cloudflare knocked but nobody answered. Usually an overloaded server or a firewall dropping packets.
  • 523 — Origin is unreachable. Cloudflare can't route to the origin at all — often a wrong IP or DNS misconfiguration at the host.
  • 524 — A timeout occurred. The origin accepted the connection but took too long to respond (heavy script, stuck database).

What visitors can do

Honestly: very little. All four are origin-side failures — the site is effectively down for everyone. Confirm with our down checker, check the site's status page for history, and try again in a few minutes. Refreshing every 10 seconds won't help.

What site owners should check

  1. 521: Is the web server (Apache/Nginx) running? Does it allow Cloudflare's IP ranges?
  2. 522: Is the server overloaded, or is a firewall blocking port 80/443?
  3. 523: Is the A record in Cloudflare pointing at the correct server IP?
  4. 524: Optimize slow queries or increase timeouts; check for stuck PHP/DB processes.

Cloudflare errors are cousins of classic server errors — see our HTTP status codes guide and the 502 Bad Gateway fix guide. And if you run a site behind a CDN, our free uptime monitoring will alert you the moment Cloudflare starts showing errors to your visitors.