521 Web Server Is Down

Cloudflare could not open a connection to the origin because it refused the connection.

Status

HTTP/1.1 521 Web Server Is Down

Details

521 means the TCP connection to the origin was actively refused. The origin server is down, is not listening on the expected port, or is blocking Cloudflare's addresses at the firewall.

The firewall case is the one that catches people out: the site works when tested from a laptop and fails through Cloudflare because the origin only allows certain source addresses.

Common causes

How to fix it

As the client

As the server

Examples

GET / HTTP/1.1
Host: www.example.com

HTTP/1.1 521
Server: cloudflare

See also