Cloudflare Error 523: Origin is unreachable

Cloudflare’s edge cannot find a working path to your origin at all — not a polite TCP refuse, not a slow connect, not a hung HTTP read. The packets have nowhere useful to go.

What visitors see

Error 523
Origin is unreachable
Cloudflare could not reach the origin web server.
Cloudflare Ray ID: …

Only orange-cloud (proxied) hostnames show this branded page. Grey-cloud traffic goes straight to the origin IP and never hits Cloudflare’s 5xx series — which is useful for diagnosis.

523 vs 521 vs 522 vs 524 vs 520

CodeWhat Cloudflare managedTypical cause
523No usable route to the origin IPWrong/stale DNS, BGP/blackhole, origin network down from CF PoPs, unreachable AAAA
521TCP to origin refusedNothing listening, firewall REJECT
522TCP connect timed outFirewall DROP, filtered path, wrong IP still “there”
524Connected; HTTP response too slowApp hung — cousin of 504
520Connected; reply empty / invalidCrash mid-response, protocol garbage
525 / 526TLS handshake or cert failedOrigin TLS / Full (strict) cert problems

Rule of thumb: 523 is a reachability / routing problem. Opening a local port or raising proxy_read_timeout will not fix it. Fix the IP Cloudflare dials, the path from Cloudflare’s network to that IP, and any allowlist that must include Cloudflare’s published ranges.

Frequent real causes

Diagnose

# What IP does the world (and CF DNS) think is origin?
dig +short example.com A
dig +short example.com AAAA
# In Cloudflare dashboard: DNS → confirm proxied record target IP matches the live origin

# Can YOU reach that IP on 80/443? (not the same path as CF, but a start)
curl -sI --connect-timeout 5 http://ORIGIN_IP/ -H "Host: example.com"
curl -sI --connect-timeout 5 https://ORIGIN_IP/ -H "Host: example.com" -k

# From the origin: confirm it has a public default route and listens
ip route | head
ss -lntup | grep -E ':80|:443'
curl -4 -s ifconfig.me; echo   # public IPv4 the host thinks it has

# Cloudflare IP allowlist (update when CF publishes new ranges):
# https://www.cloudflare.com/ips/  →  allow those in ufw/security-group/nginx real_ip
# Example sketch (IPv4 only — also add IPv6 ranges):
# for cidr in $(curl -fsS https://www.cloudflare.com/ips-v4); do
#   sudo ufw allow from "$cidr" to any port 443 proto tcp
# done

# Grey-cloud temporarily to see whether the origin answers without the proxy:
# Cloudflare DNS → click orange cloud → grey → dig again → curl https://example.com/

If dig shows an IP that is not your current server, fix DNS first. If the IP is correct but every Cloudflare PoP still 523s while a direct (grey-cloud) hit works, suspect allowlists, IPv6, or provider routing toward Cloudflare’s ASN.

Fix checklist

  1. Confirm it is 523 — refused → 521; connect timeout → 522; empty/invalid reply → 520; slow HTTP → 524; TLS → 525/526.
  2. Align DNS with the live origin — A/AAAA must be the address Cloudflare should dial. Remove private or dead IPs. Wait for DNS TTL (and Cloudflare’s edge cache of the record).
  3. Fix or drop broken AAAA — either serve working IPv6 end-to-end or delete the AAAA until you do.
  4. Allow Cloudflare IP ranges on the origin — firewall / security group / edge ACL must accept CF’s published IPv4 and IPv6 ranges on 80/443 (or your Spectrum port).
  5. Prefer Tunnel for private origins — run cloudflared outbound from the origin; point the hostname at the tunnel, not at a non-routable IP.
  6. Check provider / BGP status — confirm the VPS is up, the floating IP is attached, and there is no regional routing incident between Cloudflare and your ASN.
  7. Re-test orange-cloud — after DNS and allowlists settle, hit the site through Cloudflare again; compare Ray IDs and origin access logs.
# Quick origin listener + public IP sanity (on the server):
sudo ss -lntup 'sport = :443' 'sport = :80'
curl -4 -s https://ifconfig.me; echo
# Then from a laptop with grey-cloud or Host header to ORIGIN_IP as above.

Related

All Cloudflare error codes · Cloudflare Error 521 · Cloudflare Error 522 · Cloudflare Error 524 · Cloudflare Error 520 · Cloudflare Error 525 · Cloudflare Error 526 · 502 Bad Gateway · localhost refused to connect · ERR_NAME_NOT_RESOLVED · Anvil HTTP status · Wirebook: when sites get tired

Questions

What does Cloudflare Error 523 mean?

Cloudflare could not reach your origin over the network — no usable route to the origin IP from its PoP. Fix DNS, routing, or allowlists; it is not a TCP refuse (521) or connect timeout (522).

How is 523 different from 521?

521 means something at the origin actively refused the TCP connection (RST / REJECT). 523 means Cloudflare could not get a usable path to the origin IP at all.

How is 523 different from 522?

522 is a connect timeout — packets often go somewhere and never finish the handshake (DROP, filtered path). 523 is reported when the origin is unreachable / unroutable from Cloudflare’s view.

Can a wrong A or AAAA record cause 523?

Yes. Stale, private, or dead origin IPs in Cloudflare DNS are a top cause. Align A/AAAA with the live public address or use Cloudflare Tunnel.

Do I need to allowlist Cloudflare IPs?

If your origin firewall only allows specific sources, yes — include Cloudflare’s published IPv4 and IPv6 ranges on the ports Cloudflare dials (usually 80/443).

Will raising proxy_read_timeout fix 523?

No. That helps slow origins (524 / 504 territory). 523 never gets a working path to start an HTTP read.

Should I use Cloudflare Tunnel instead of a public origin IP?

When the origin has no stable public route (home lab, private VPC), Tunnel is the right model: outbound connector, no inbound allowlist gymnastics.

Published .

Try it

Related guides

Newest guides