Error Codes Wiki

HTTP 521 Web Server Is Down — Cloudflare Origin Server Unreachable

Critical5xx server error

Overview

Fix Cloudflare HTTP 521 error when the origin web server refuses or is unable to accept connections from Cloudflare's proxy.

Key Details

  • HTTP 521 is a Cloudflare-specific error indicating the origin server actively refused the connection
  • Cloudflare acts as a reverse proxy and must connect to your origin server to serve content
  • This error means Cloudflare cannot reach your web server at all — not even a timeout, but a direct refusal
  • The origin server may be down, firewalled, or not listening on the expected port
  • Unlike 522 (connection timed out), 521 means the connection was immediately rejected

Common Causes

  • Origin web server (Nginx, Apache) is stopped or crashed
  • Firewall on the origin server blocking Cloudflare IP ranges
  • Origin server listening on wrong port (e.g., only 8080 instead of 443)
  • Hosting provider suspended the account or server

Steps

  1. 1Verify the origin web server is running: systemctl status nginx or systemctl status apache2
  2. 2Whitelist all Cloudflare IP ranges in your server firewall (cloudflare.com/ips)
  3. 3Confirm the server is listening on port 443 (HTTPS) or 80 (HTTP): ss -tlnp | grep ':443'
  4. 4Check hosting provider dashboard for any account suspensions or resource limits
  5. 5Temporarily pause Cloudflare proxy (grey cloud) to test direct connection to origin

Tags

cloudflare521origin-serverweb-server-downproxy

More in 5xx Server Error

Frequently Asked Questions

HTTP 521 is not an official HTTP status code. It is specific to Cloudflare's proxy infrastructure, indicating their edge servers cannot connect to your origin server.