HTTP 521 — Web Server Is Down
HTTP 521
Web Server Is Down
Cloudflare could not connect to the origin server because it refused the connection.
What 521 actually means
A Cloudflare-specific code, not part of HTTP. It means Cloudflare tried to open a connection to the site's own server and was actively refused — the port is closed, nothing is listening, or a firewall rejected it. The distinguishing feature is that the refusal was immediate rather than a timeout, which points at a service that is stopped or a firewall rule blocking Cloudflare specifically.
Common causes
- The origin web server process is stopped or crashed
- A firewall or security group blocking Cloudflare's IP ranges
- The origin listening on a different port than Cloudflare is configured to use
- A DDoS-protection tool at the origin blocking Cloudflare as suspicious traffic
- The server rebooting or mid-deploy
If you're just trying to view the page
- Wait and reload — if the site's server is restarting this clears on its own
- Nothing else on your side; the site's origin server is unreachable
- Note the Ray ID from the error page if you report it
If it's your site
- Confirm the web server is running on the origin and listening on the expected port
- Allow Cloudflare's published IP ranges through the firewall; blocking them is the most common cause
- Check for a host-level tool such as fail2ban or CSF that has banned Cloudflare IPs after seeing high request volume
- Verify that Cloudflare's configured origin port matches what the server actually listens on (80/443, or a supported alternative)
Reference
- Status code
- 521
- Reason phrase
- Web Server Is Down
- Category
- 5xx — Server Error
- Cacheable by default
- No
Common questions
- What does HTTP 521 mean?
- Cloudflare could not connect to the origin server because it refused the connection. A Cloudflare-specific code, not part of HTTP. It means Cloudflare tried to open a connection to the site's own server and was actively refused — the port is closed, nothing is listening, or a firewall rejected it.
- How do I fix a 521 error?
- Wait and reload — if the site's server is restarting this clears on its own
- Is 521 a client error or a server error?
- 521 is in the 5xx range, which means server error. The request was acceptable but the server could not fulfil it, so retrying later can succeed.
Related pages
- 500 Internal Server Error Something went wrong on the server and it has no more specific code to describe
- 502 Bad Gateway A proxy or gateway reached the server behind it and got back a broken response,
- 503 Service Unavailable The server is temporarily unable to handle the request, usually because it is ov
- 504 Gateway Timeout A proxy or gateway waited for the server behind it and gave up before an answer
- 524 A Timeout Occurred Cloudflare connected to the origin successfully but the origin did not finish re
- 522 Connection Timed Out Cloudflare tried to open a connection to the origin server and never got a reply
- 520 Web Server Returned an Unknown Error Cloudflare reached the origin server but got back a response it could not make s
- 525 SSL Handshake Failed The TLS handshake between Cloudflare and the origin server failed.
- 526 Invalid SSL Certificate The origin server presented a TLS certificate that Cloudflare could not validate
- 530 Origin DNS Error A Cloudflare error shown alongside a 1xxx error code that carries the real expla
- 501 Not Implemented The server does not support the functionality needed to fulfil the request, usua
- 511 Network Authentication Required You need to log in to the network itself — this is a captive portal, not the sit