Free auditStart free
GuideError · CDN and hosting

Cloudflare error 521: web server is down

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
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
  2. How to get past a 521 as a visitor
  3. How to find the cause as a site owner
  4. 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 withChatGPTClaudePerplexityGoogleAI Mode
01The 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 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. A 521 is not aimed at you as a visitor. It is Cloudflare reporting that your origin would not accept its connection.

02How it works

How to get past a 521 as a visitor

Cloudflare says that when most 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.

03How 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, 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
CauseWhere to lookFix
Web server not runningProcess status, web server error logStart it, fix the crash, add monitoring
Wrong port for the SSL/TLS modeListening ports, Cloudflare SSL/TLS overviewListen on 80 (Flexible) or 443 (Full, Full strict), or change the mode
Cloudflare IPs blockedOrigin firewall, host security tools, rate limit rulesAllow all published Cloudflare IP ranges
No HTTPS at origin in a Full modeOrigin certificate setupInstall a Cloudflare Origin Certificate or a valid certificate

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

04Explained

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 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. 01Error 521 - Cloudflare Support docsdevelopers.cloudflare.com · checked 2026-10-25
  2. 02Error 520 - Cloudflare Support docsdevelopers.cloudflare.com · checked 2026-10-25
  3. 03Cloudflare 5xx errors - Cloudflare Support docsdevelopers.cloudflare.com · checked 2026-10-25
  4. 04Cloudflare IP addresses - Cloudflare Fundamentals docsdevelopers.cloudflare.com · checked 2026-10-25
  5. 05Encryption modes - Cloudflare SSL/TLS docsdevelopers.cloudflare.com · checked 2026-10-25
  6. 06IANA: Hypertext Transfer Protocol (HTTP) Status Code Registryiana.org · checked 2026-10-25
  7. 07How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-10-25
Questions

Asked a lot.

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

01What 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.

02How 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).

03Is 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.

04What 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.

Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane