521 Web Server Is Down

Cloudflare could not establish an accepted connection to the origin web server.

All HTTP status codes

What does HTTP 521 mean?

The domain can resolve and Cloudflare can answer while the origin refuses its connection. Common investigation points are a stopped web server, incorrect listener or a firewall rejecting Cloudflare addresses. Verify the target origin and intended port before changing access rules. Permitting all inbound traffic is broader than necessary and can conceal an incorrect origin configuration.

An investigation example

Illustrative origin-restart investigation
Public result: 521 Web Server Is Down
Origin service is not listening after a failed restart.
Action: repair startup configuration and restore the intended listener.
Verify: Cloudflare can connect and the public hostname serves the expected application.

Common causes

  • The origin web server is stopped or not listening on the expected HTTP or HTTPS port.
  • A firewall or hosting security rule actively rejects Cloudflare connections.
  • The configured origin address reaches a server that is not serving this site.

Diagnose the response

Check the origin listener and firewall decisions for Cloudflare traffic, including whether the service is actually running on the configured port.

  • Confirm the origin service is running and listening on the port Cloudflare is expected to use. Review process failures before restarting an unstable service repeatedly.
  • Check the origin address and narrowly scoped firewall rules. Use Cloudflare's current published address ranges when reviewing trusted edge access, rather than a remembered static list.
  • Test the public hostname through Cloudflare after correcting the listener or access rule. Keep the intended origin restrictions instead of opening every port to eliminate a refusal.

What it means for website monitoring

A 521 directs the investigation toward connection acceptance at the origin. Confirm the public proxied route after restoring the listener, including representative application pages.

Reference