Web Hosting

Fix Cloudflare Error 521 "Web Server Is Down"

Error 521Web server is downCloudflare can't reach the origin
5 min read Updated 12 June 2026 ESAGAMES Team

Cloudflare error 521 means Cloudflare reached your domain but couldn't connect to your origin server. The site itself, the firewall, or the origin IP is the problem. Here's how to fix it.

Cause 1: the web server is actually down

First, the obvious one — is the origin running? Restart it and confirm it listens on 80/443:

systemctl status nginx   # or apache/litespeed
ss -tlnp | grep -E ':80|:443'

Cause 2: the firewall is blocking Cloudflare

If your firewall blocks Cloudflare's IPs, the origin looks "down" to them. Allow Cloudflare's IP ranges to reach ports 80/443 — a common cause after tightening a firewall or installing CSF.

Cause 3: wrong origin IP in DNS

If the Cloudflare DNS A record points to an old/wrong IP, it can't reach the real server. Make sure the (proxied) A record has your current origin IP.

Test the origin directly

Bypass Cloudflare by pointing your hosts file (or curl --resolve) at the origin IP. If it loads directly but 521s through Cloudflare, it's a firewall/IP issue, not the site.

521 = Cloudflare can't reach your origin. Confirm the server is up, allow Cloudflare's IPs, and check the origin IP in DNS.

Protected hosting without the hassle

Our hosting includes DDoS protection at the network edge — no fragile origin setup to keep alive.

See web hosting
FAQ

Frequently asked questions

What does Cloudflare error 521 mean?

Cloudflare connected to your domain but couldn't reach the origin server. The web server is down, a firewall is blocking Cloudflare's IPs, or the origin IP in DNS is wrong.

How do I fix Cloudflare 521?

Make sure your web server is running and listening on 80/443, allow Cloudflare's IP ranges through your firewall, and confirm the proxied A record points to your current origin IP.

How do I know if it's my server or the firewall?

Test the origin directly (curl --resolve or a hosts-file entry to the IP). If it loads directly but 521s via Cloudflare, the firewall is blocking Cloudflare's IPs.

Knowledge base

Related articles

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.

Payments Secure checkout with cards, banking apps and digital wallets.

Choose the payment flow that fits your stack and region without leaving the platform.

Pay by Zen Visa Mastercard Paysafecard PaysafeCash Skrill Trustly Bancontact UnionPay iDeal WebMoney