Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›Cloudflare Error 521 Web Server Is Down
5xx Server Error · non-standard

Cloudflare Error 521 Web Server Is Down

Cloudflare error 521 means Cloudflare could not connect to your origin server because the connection was refused. The web server is down, not listening on…

Quick answer

Cloudflare error 521 means Cloudflare could not connect to your origin server because the connection was refused. The web server is down, not listening on port 80/443, or a firewall is blocking Cloudflare’s IP addresses.

Last updated · Maintained by FreeAIToolz · How we test

What does Cloudflare Error 521 Web Server Is Down mean?

Cloudflare tried to open a TCP connection and the origin actively refused it. Either nothing is listening, or something (iptables, a hosting firewall, fail2ban) is rejecting Cloudflare.

Status code521
NameWeb Server Is Down
Class5xx Server Error
Defined inCloudflare (non-standard)
Safe to retry automatically?Yes, with backoff

What causes Cloudflare Error 521?

  • The web server (Nginx, Apache) is stopped or crashed.
  • The origin firewall or a security plugin blocks Cloudflare IP ranges.
  • The server listens on a port Cloudflare is not using.

How do I fix Cloudflare Error 521?

  1. Restart and check the web server (systemctl status nginx).
  2. Allow all Cloudflare IP ranges (cloudflare.com/ips) in the firewall.
  3. Make sure the server listens on 443 (for Full SSL) or 80.

What should a client do after Cloudflare Error 521?

Retry later; the site owner must bring the origin back.

Does Cloudflare Error 521 affect SEO?

Treated as a server error; if it lasts more than a short time, pages can drop from Google.

Other 5xx status codes

The server failed to fulfil a valid request. Retrying later, with backoff, is usually reasonable.

Frequently asked questions

521 vs 522?
521: the origin refused the connection. 522: the connection attempt timed out.
Can fail2ban cause 521?
Yes. If it bans Cloudflare IPs (seeing many requests from them), Cloudflare gets refused. Use real visitor IPs (CF-Connecting-IP) for bans.
Is 521 a client or server error?
521 is in the 5xx class, a server error: the request may be fine, but the server (or the origin behind Cloudflare) could not complete it.