Question

How to fix Cloudflare 523 origin unreachable

523 usually means Cloudflare cannot route traffic to the origin address in your DNS record. The origin may be running perfectly from inside your cloud provider, but Cloudflare's edge cannot reach the public IP. That makes 523 a routing and reachability problem before it is an application problem.

The common trap is checking only from the server itself. A local curl localhost proves the service is alive; it does not prove the public route from Cloudflare to the origin IP works.

Fast diagnosis order

  1. Verify the origin public IP currently attached to your server or load balancer.
  2. Verify Cloudflare DNS A/AAAA records point to the expected address.
  3. Test direct origin reachability from outside your VPC/network.
  4. Check network ACL, security group, and upstream firewall allow rules.
  5. Check whether IPv6 is published but not actually reachable.

What makes 523 different

A 522 timeout can happen when the origin is reachable but slow or silently dropping connections. A 523 is more fundamental: the address Cloudflare is trying to use is not reachable from Cloudflare's network. That often happens after server migration, IP recycling, provider firewall changes, broken BGP/routing, or an accidental AAAA record.

Cloudflare's 5xx troubleshooting guidance also points owners toward logs on load balancers, caches, proxies, and firewalls between Cloudflare and the origin. For 523, those middle layers are especially important because the application may never see the failed request.

Commands operators usually run first

# DNS answers (what Cloudflare records currently return)
dig +short llmsfile.com A
dig +short www.llmsfile.com A
dig +short llmsfile.com AAAA
dig +short www.llmsfile.com AAAA

# Route and direct origin checks
ip route
curl -I --connect-timeout 8 http://ORIGIN_IP
curl -I --connect-timeout 8 https://ORIGIN_IP -k

# If origin only serves by hostname/SNI
curl -I --resolve yourdomain.com:443:ORIGIN_IP https://yourdomain.com/

# From the origin, confirm the public address really belongs to this host
ip addr
curl -s ifconfig.me

Evidence to collect before editing DNS

Typical 523 root causes

Cloudflare DNS check matrix

Small production example

A site is moved from one VM to another. The new VM serves the app, and curl localhost works, but Cloudflare still returns 523. dig shows the apex domain still points to the old floating IP, while curl ifconfig.me on the new host shows a different public IP. The fix is not restarting Caddy or Nginx; it is updating the Cloudflare A record, waiting for propagation, and confirming the new IP is reachable from outside the provider network.

Fix order that avoids downtime

  1. Confirm the intended origin IP and keep the old origin alive if possible.
  2. Update stale A/AAAA records in Cloudflare DNS.
  3. Remove broken AAAA records until IPv6 is actually serving the same site.
  4. Open only required ports, usually 80 and 443, from Cloudflare and your own admin IPs.
  5. Re-test apex, www, robots.txt, and sitemap from a network outside the origin provider.

After-fix validation

  1. Public pages return 200/301/304 through Cloudflare.
  2. No recurring 523 on homepage, /robots.txt, and top question pages.
  3. Logs show stable crawler access instead of edge-unreachable errors.

Useful references: Cloudflare 5xx troubleshooting docs and the LLMs File 52x checklist generator.

If the origin is reachable but requests time out, continue with Cloudflare 522 timeout troubleshooting.

Generate full 523 checklist