HTTP Errors

What Is Cloudflare Error 521? (Web Server Is Down)

On this page

HTTP 521 Web Server Is Down is the error Cloudflare shows when it cannot reach the website's actual server. Cloudflare sits in front of many sites as a middleman (it speeds them up and filters traffic). When you request a page, Cloudflare tries to fetch it from the origin server - the real machine that hosts the site. If that origin refuses or drops the connection, Cloudflare can't get the page and returns a 521. Cloudflare itself is working fine; the problem is behind it. You'll see Cloudflare's branded 521 page with a ray ID (a unique reference code for that request). It's also written "HTTP 521" or just "521 error" / "521 status code."

Quick facts

Status code521 (Cloudflare)
MeaningWeb Server Is Down
Category5xx (Cloudflare edge)
Common causes (scraping)Origin down, origin blocking Cloudflare IPs, origin misconfig
Right responseFix the request / retry with backoff; for disguised blocks use a real-browser unblock

What a 521 Web Server Is Down means

Cloudflare tried to open a connection to the origin server - the real machine hosting the site - and failed. Cloudflare itself is up; the server behind it refused or dropped the connection. You'll see Cloudflare's branded 521 page with a ray ID (a reference code for the failed request). In short, a 521 means Cloudflare couldn't open a connection to the origin server.

Why scrapers see 521

A 521 is an origin-side problem: the site's own server is down, is blocking the IP ranges Cloudflare connects from, or is misconfigured. For a scraper this is usually temporary and not a personal block aimed at you - though it can sometimes show up alongside aggressive edge rules (extra filtering Cloudflare applies at its network edge before traffic reaches the origin).

How to fix a 521 error

Retry with backoff - wait a bit and try again, increasing the gap each time. A 521 usually clears once the origin recovers, and there's nothing in your headers or IP to change, because the failure happens between Cloudflare and the origin, not in your request. If you only get 521 through certain proxies, test the site directly (no proxy) to rule out a proxy problem. When you need reliable access to Cloudflare-fronted sites despite these intermittent edge errors, Web Access API and WAF handling handle the retries and challenges for you.

Related terms

Concept map

How Cloudflare Error 521 connects

The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.

0 terms · 0 connections
You are here · HTTP Errors
Building map…

Frequently asked questions

Is 521 a client or server error?

It's a server-side error (the 5xx family). The problem is between servers - Cloudflare and the origin - not in your request.

Does a 521 mean I'm blocked when scraping?

Not usually. A 521 is typically temporary and server-side, though it can occasionally coincide with edge blocking.

How do I fix a 521 error?

The cause is that Cloudflare couldn't open a connection to the origin server, so the fix targets that: retry with backoff (waiting longer between attempts) and use reliable infrastructure.

What's the difference between Cloudflare 521 and 520?

A 520 is a generic 'unknown error' - the origin replied, but with something Cloudflare can't make sense of. A 521 is more specific: Cloudflare couldn't connect to the origin at all because it's down or refusing connections.

Last updated: 2026-05-31