521: Web Server Is DownHTTP 521 Web Server Is Down is a Cloudflare-specific status code indicating that the origin web server refused Cloudflare's connection. This typically means the origin server is down, crashed, or is actively refusing connections on the expected port. Cloudflare acts as a reverse proxy, and when it cannot establish a TCP connection to the origin, it returns 521 to the visitor.
521 Web Server Is DownGET / HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/htmlHTTP/1.1 521 Web Server Is Down
Content-Type: text/html; charset=utf-8
Server: cloudflare
CF-Ray: 8a1b2c3d4e5f6789-IAD
Content-Length: 316
<!doctype html>
<html lang="en">
<head>
<title>Error 521: Web server is down</title>
</head>
<body>
<h1>Error 521: Web server is down</h1>
<p>Cloudflare could not connect to the origin web server.</p>
<p>Please try again in a moment. If the problem persists, contact the site owner.</p>
</body>
</html>SSH into your origin server and check that the web server process is running and listening on the correct port.
sudo systemctl status nginx && ss -tlnp | grep ':80\|:443'
Ensure your firewall allows connections from all Cloudflare IP ranges. Cloudflare publishes their IP ranges at cloudflare.com/ips.
Test whether the origin server's port is reachable from the internet, bypassing Cloudflare.
Scan PortsThe web server process (Nginx, Apache, Node.js) on the origin server has stopped running or crashed.
The origin server's firewall is blocking connections from Cloudflare's IP ranges, preventing the reverse proxy connection.
The web server is running but listening on a different port than what Cloudflare is configured to connect to (typically 80 or 443).
Cloudflare could not negotiate a TCP handshake with the origin server (Cloudflare).
Cloudflare established a TCP connection but the origin server did not respond with an HTTP response in time (Cloudflare).
The server received an invalid response from the upstream server.
This reference was compiled from official RFCs, protocol specifications, and hands-on troubleshooting experience. AI tools were used primarily for formatting and organizing the content on the page.