# Cloudflare error 521: web server is down

> Cloudflare error 521 means the origin server refused Cloudflare

Canonical: https://scaplet.com/errors/http/521

Guide Error · CDN and hosting

Cloudflare error 521 means the origin server refused Cloudflare's connection. See the two common causes, how to confirm each and what to change.

4 min

read

7

sources

Oct 21, 2026

updated

Scaplet Editorial Team

author

521 5xx · Server error

The short answer

Cloudflare error 521 means the origin web server refused the connection from Cloudflare. It is a Cloudflare-defined status, not a standard HTTP one. The two usual causes are an origin web server application that is offline and an origin firewall that blocks Cloudflare's IP addresses. Visitors cannot fix it; the site owner or host has to.

1. [What error 521 means and who causes it](#what-error-521-means-and-who-causes-it)
2. [How to get past a 521 as a visitor](#how-to-get-past-a-521-as-a-visitor)
3. [How to find the cause as a site owner](#how-to-find-the-cause-as-a-site-owner)
4. [What it does to SEO](#what-it-does-to-seo)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F521%20(%22Cloudflare%20error%20521%3A%20web%20server%20is%20down%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F521%20(%22Cloudflare%20error%20521%3A%20web%20server%20is%20down%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F521%20(%22Cloudflare%20error%20521%3A%20web%20server%20is%20down%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F521%20(%22Cloudflare%20error%20521%3A%20web%20server%20is%20down%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

_01_The two common causes of a 521

## What error 521 means and who causes it

A 521 is not in the HTTP standard. The IANA [status code](/glossary/http-status-codes) registry lists 512 to 599 as unassigned, and Cloudflare defines 521 itself. Cloudflare's documentation says error 521 "occurs when the origin web server refuses connections from Cloudflare." The connection never gets as far as a request, so the cause is at your origin or in the network rules in front of it.

Cause

### Origin web server application is offline

What is happening

Nothing is running or listening where Cloudflare connects

Who can fix it

Site owner or host

Cause

### Cloudflare requests are blocked

What is happening

A firewall or security tool at the origin blocks or rate limits some Cloudflare IP addresses

Who can fix it

Site owner or host

Cloudflare notes that security solutions at the origin may block legitimate connections from certain Cloudflare IP addresses. Cloudflare explains that all visitor traffic reaches your origin from shared Cloudflare IP addresses, which to a firewall can look like a few sources sending high volume and may trigger automatic blocking or [rate limiting](/glossary/rate-limiting). A 521 is not aimed at you as a visitor. It is Cloudflare reporting that your origin would not accept its connection.

_02_How it works

## How to get past a 521 as a visitor

Cloudflare says that when most [5xx errors](/errors/http/5xx-errors) appear, the right first step is to contact the hosting provider or site administrator, and that Cloudflare Support only assists the domain owner. As a visitor you can do little beyond waiting and ruling out your own setup.

1. 01

### Reload after a minute

A reload costs nothing and may work if the origin was briefly down. A 521 that persists needs the owner to act.
2. 02

### Try another network or device

If the page loads on mobile data or on someone else's connection, the problem is local. If it fails everywhere, the site has the fault.
3. 03

### Tell the site owner

Send the exact URL, the time with your timezone and the error code. Cloudflare lists those details for owners to give a hosting provider. Add the Ray ID if the error page shows one, since Cloudflare's log tools can filter by it.

_03_How it works

## How to find the cause as a site owner

Work through Cloudflare's own checklist in order. Start with whether the origin answers at all, then check what Cloudflare is allowed to reach.

1. 1

### Confirm the origin is responsive

Check that the web server process is up and review its error logs for crashes or outages.
2. 2

### Confirm Cloudflare is not blocked or rate limited

Cloudflare says to allow all of its IP ranges in the origin's firewall or other security software, and to confirm they are not blocked or rate limited. The ranges are published on its IP addresses page.
3. 3

### Match the port to your SSL/TLS mode

The origin application must be bound and listening on port 80 for Flexible, or port 443 for Full and Full (strict).
4. 4

### Check HTTPS support for Full modes

In Full or Full (strict) mode the origin must support [HTTPS](/glossary/https), with a Cloudflare Origin Certificate or a certificate that meets the mode's requirements.

Check what the origin is listening on

```
# On the origin host: is anything bound to 80 or 443? ss -tlnp | grep -E ':(80|443)\b' # From another machine, test the origin IP directly curl -sSI --max-time 10 https://ORIGIN_IP/ -H 'Host: example.com' -k
```

Allow a Cloudflare IP range with iptables (Cloudflare's example)

```
# Run once per range listed at https://www.cloudflare.com/ips (replace $ip) # IPv4 iptables -I INPUT -p tcp -m multiport --dports http,https -s $ip -j ACCEPT # IPv6 ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $ip -j ACCEPT
```

Where to look for each 521 cause
| Cause | Where to look | Fix |
| Web server not running | Process status, web server error log | Start it, fix the crash, add monitoring |
| Wrong port for the SSL/TLS mode | Listening ports, Cloudflare SSL/TLS overview | Listen on 80 (Flexible) or 443 (Full, Full strict), or change the mode |
| Cloudflare IPs blocked | Origin firewall, host security tools, rate limit rules | Allow all published Cloudflare IP ranges |
| [No HTTPS](/seo-issues/no-https) at origin in a Full mode | Origin certificate setup | Install a Cloudflare Origin Certificate or a valid certificate |

**Pause Cloudflare to test**Cloudflare's error 520 page suggests setting the affected DNS record to DNS-only, or temporarily pausing Cloudflare, as a workaround while you troubleshoot. If the origin also fails without Cloudflare, the fault is the server itself.

Cloudflare can also show 521 neighbours that look similar. A [522 connection timed out](/errors/http/522) means the origin did not answer in time, rather than refusing, and a [525 SSL handshake failure](/errors/http/525) means the connection opened but TLS failed. A plain [502](/errors/http/502) with Cloudflare branding means your origin itself sent that status.

_04_Explained

## What it does to SEO

Google treats 5xx responses as server errors: its crawlers slow down, content returned with them is ignored, and URLs already indexed are kept for a while but eventually dropped if the errors persist. A 521 on a page Google crawls is a 5xx from its point of view, so fix it quickly. See [5xx server errors](/seo-issues/server-errors-5xx) for how to trace the pattern and confirm recovery, and Google's documentation on how HTTP status codes affect its crawlers.

Sources · 7

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- cloudflare.com
- iana.org
- google.com

1. 01 [Error 521 - Cloudflare Support docs](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-521/) developers.cloudflare.com · checked 2026-10-25
2. 02 [Error 520 - Cloudflare Support docs](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-520/) developers.cloudflare.com · checked 2026-10-25
3. 03 [Cloudflare 5xx errors - Cloudflare Support docs](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/) developers.cloudflare.com · checked 2026-10-25
4. 04 [Cloudflare IP addresses - Cloudflare Fundamentals docs](https://developers.cloudflare.com/fundamentals/concepts/cloudflare-ip-addresses/) developers.cloudflare.com · checked 2026-10-25
5. 05 [Encryption modes - Cloudflare SSL/TLS docs](https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/) developers.cloudflare.com · checked 2026-10-25
6. 06 [IANA: Hypertext Transfer Protocol (HTTP) Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) iana.org · checked 2026-10-25
7. 07 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-10-25

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ What does HTTP 521 mean?

It is a Cloudflare-specific status meaning the origin web server refused the connection from Cloudflare. It is not defined in the HTTP standard; Cloudflare's documentation defines it.

_02_ How can I fix error code 521?

Make sure the origin web server is running, allow all Cloudflare IP ranges in the origin firewall, and confirm the server listens on the port your SSL/TLS mode needs: 80 for Flexible, 443 for Full and Full (strict).

_03_ Is a 521 error my fault as a visitor?

No. The refusal happens between Cloudflare and the site's origin server. Cloudflare says site visitors should report the problem to the site owner.

_04_ What is the difference between 521 and 522?

A 521 means the origin refused Cloudflare's connection. A 522 means Cloudflare timed out contacting the origin, either before the TCP connection was set up or while waiting for acknowledgment of its request.

## Keep learning

[All errors](/errors)

[Learn Cloudflare error 522: connection timed out CDN and hosting errors](/errors/http/522) [Related 503 Service Unavailable HTTP status codes](/errors/http/503) [Read next Cloudflare error 523: origin is unreachable CDN and hosting errors](/errors/http/523) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in errors
[510 Not Extended](/errors/http/510) [511 Network Authentication Required](/errors/http/511)

More in CDN and hosting errors
[Cloudflare error 521: web server is down](/errors/http/521) [Cloudflare error 522: connection timed out](/errors/http/522) [Cloudflare error 523: origin is unreachable](/errors/http/523) [Cloudflare error 524: a timeout occurred](/errors/http/524) [Cloudflare error 525: SSL handshake failed](/errors/http/525) [Cloudflare error 526: invalid SSL certificate](/errors/http/526) [Cloudflare error 530](/errors/http/530)

Terms on this page
[HTTP status codes](/glossary/http-status-codes) [Rate limiting](/glossary/rate-limiting) [HTTPS](/glossary/https)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
