521 Web Server Is Down β
Meaning β
A Cloudflare-specific status indicating that the origin web server refused the connection. Cloudflare could not establish a connection to the origin server, perhaps because it is offline.
When to Use β
When Cloudflare (or a similar intermediary) cannot reach the origin server at all (connection refused or host down). It tells the client that the origin server appears to be offline or unreachable, distinct from a timeout (522) or other issues.
Example β
Cloudflare will return a 521 Web Server Is Down if, for example, the origin server is not running or is actively refusing connections on the port. The client sees this and knows the site is down (at least from Cloudflareβs perspective).
When Not to Use β
Do not use on a typical server; this is generated by proxies like Cloudflare. If you're running your own gateway and the upstream is down, a more standard approach is 502 or 504. 521 is specifically part of Cloudflare's error set.
Source β
Unofficial (Cloudflare)