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 code | 521 |
|---|---|
| Name | Web Server Is Down |
| Class | 5xx Server Error |
| Defined in | Cloudflare (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?
- Restart and check the web server (systemctl status nginx).
- Allow all Cloudflare IP ranges (cloudflare.com/ips) in the firewall.
- 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.
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 507 Insufficient Storage
- 508 Loop Detected
- 511 Network Authentication Required
- 520 Web Server Returned an Unknown Error
- 522 Connection Timed Out
- 523 Origin Is Unreachable
- 524 A Timeout Occurred
- 525 SSL Handshake Failed
- 526 Invalid SSL Certificate
Frequently asked questions
521 vs 522?
Can fail2ban cause 521?
Is 521 a client or server error?
Related
- 522 Connection Timed Out Cloudflare error 522 means Cloudflare’s TCP connection to your origin server timed out before it was establish.
- 520 Web Server Returned an Unknown Error Cloudflare error 520 means the origin server returned an empty, unknown or unexpected response to Cloudflare.
- 523 Origin Is Unreachable Cloudflare error 523 means Cloudflare cannot reach your origin server at all, usually because the DNS record p.
- 503 Service Unavailable HTTP 503 Service Unavailable means the server is temporarily unable to handle the request, because it is overl.
- Open the HTTP Status Codes Reference → Free, no signup.