Cloudflare Error 521: Web Server Is Down
Quick answer
Error 521 means your origin refused Cloudflare's connection. Check that the web server is running, then allowlist Cloudflare IP ranges in the origin firewall.
Most likely fix: Confirm the origin is up
How to fix it
Try these in order — the most common fix is first.
1. Confirm the origin is up
- Open the server directly by IP or via SSH and check the web server (nginx/Apache) is running
- Read the origin error log for crashes at the time of the error
- Restart the web server if it stopped
Did this fix it?2. Allowlist Cloudflare IP ranges
- Copy the ranges from cloudflare.com/ips
- Allow them in iptables, ufw, cloud security groups and any security plugin
- Remove rate limits that apply to those IPs
Did this fix it?3. Match the SSL mode to the port
- Open SSL/TLS > Overview in the dashboard
- Flexible connects on port 80, Full and Full (strict) on port 443
- Install a valid certificate or a free Cloudflare Origin CA certificate if using Full
Did this fix it?
Symptoms
The page shows 'Error 521 Web server is down' with a Cloudflare Ray ID, while the site may load when Cloudflare is paused.
Why it happens
- Origin web server is offline or crashed
- Origin firewall or security plugin blocking Cloudflare IPs
- Server not listening on port 80 (Flexible) or 443 (Full / Full strict)
- Origin has no valid certificate under Full or Full (strict)
This guide also covers
- cloudflare error 521
- web server is down cloudflare
- error 521 cloudflare fix
Still not working?
If Cloudflare keeps failing, you're not alone. See every Cloudflare problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Cloudflare errors
- Cloudflare Error 522: Connection Timed Out
- Cloudflare Error 524: A Timeout Occurred
- Cloudflare Error 525: SSL Handshake Failed
- Cloudflare Error 526: Invalid SSL Certificate
- Cloudflare Error 520: Web Server Returned an Unknown Error
- Cloudflare Error 1020: Access Denied
- Cloudflare Error 1015: You Are Being Rate Limited
- Cloudflare Error 1016: Origin DNS Error