Skip to content

Is it Cloudflare or is it you? The isolation drill when a proxied site goes down

The site is unreachable and Cloudflare sits in the middle. Three curl commands separate an edge incident from a dead origin from a DNS problem — and each verdict has a different next move.

With Cloudflare in the middle, “the site is down” has three different meanings: the edge is broken (Cloudflare incident), the path behind the edge is broken (your origin or its network), or the name never resolves (DNS). Each has a different fix and two of them are not yours to fix — so the first five minutes belong to isolation, not action. Three commands settle it: does the hostname resolve, does the edge answer with a cf-ray, and does the origin answer when you connect to it directly. Run them before touching anything, because the most expensive mistake in this scenario is “fixing” the layer that was healthy.

What’s happening

Cloudflare’s error pages encode the verdict if you read them correctly. A 52x with Cloudflare branding means the edge is working — it received your request and failed to get a good answer from your origin: 521 means the origin refused the connection, 522 timed out, 523 was unreachable, 525/526 failed TLS. Those errors point at your side, and the deep-dive for the most common one is error 522: origin unreachable. A Cloudflare-branded 500/502 naming Cloudflare itself, or connection failures with no cf-ray header anywhere, point at the edge. And the mirror case fools people weekly: during a genuine origin outage, cached and static content keeps serving normally, so the homepage looks fine while every login and API call fails.

The reason discipline matters: the tempting mid-incident moves are destructive. Grey-clouding during a Cloudflare incident publishes your origin IP permanently and sends visitors to a firewall that drops non-Cloudflare traffic. Rebooting a healthy origin because the edge threw 500s adds a real outage to a vicarious one.

What to check first

  • Blast radius. One user, one region, or everyone? One complaint from one network is a resolver or ISP problem until proven otherwise.
  • The Cloudflare status page — www.cloudflarestatus.com, from memory or a bookmark, since it is what you check when things are broken.
  • Your own change log. If a zone change shipped in the last hour, suspect it before suspecting either infrastructure; the ladder for undoing it is in rolling back a bad Cloudflare change.

How to verify

The drill, in order, from a machine that is not inside the affected network:

# 1. Does the name resolve? (two independent resolvers)
dig +short www.example.com @1.1.1.1
dig +short www.example.com @8.8.8.8

# 2. Does the edge answer? cf-ray present = you reached Cloudflare
curl -m 10 -sI https://www.example.com/ | grep -iE 'HTTP/|cf-ray|server'

# 3. Does the origin answer directly? (from an allowlisted host)
curl -m 10 -s -o /dev/null -w '%{http_code} in %{time_total}s\n' \
  --resolve www.example.com:443:<origin-ip> https://www.example.com/healthz

# 4. Force an uncached path — cached 200s lie during origin outages
curl -m 10 -sI "https://www.example.com/healthz?nocache=$(date +%s)" | grep -iE 'HTTP/|cf-cache-status'

Read the matrix: resolution fails — DNS problem, stop there. cf-ray present with 52x — edge healthy, origin path broken, go to the origin. No cf-ray, connection errors, status page red — Cloudflare incident, your origin is probably fine; confirm with check 3. All checks green but users still complain — collect a traceroute and cf-ray value from an affected user; regional edge issues and ISP problems live in that gap. Keeping check 3 permanently runnable — allowlisted probe host, documented origin IP — is exactly the setup described in monitoring origin health behind the proxy.

The fix

  1. Verdict: origin down. Standard incident response on your side — service, host, network, firewall. Leave the Cloudflare config alone; when the origin returns, the 52x errors evaporate with no edge changes. Resist “temporarily” toggling proxy status mid-incident; it adds DNS propagation to your recovery time.
  2. Verdict: Cloudflare incident. Mostly, you wait — and communicate. Post status for your users, note the incident ID, and do not grey-cloud unless the outage is long, business-critical, and your origin was built for direct exposure (publicly valid certificate, firewall that can open beyond Cloudflare ranges, capacity without the cache). That decision should have been made calmly in advance as part of your rollback plan, not invented at 2 a.m.
  3. Verdict: DNS. Check registrar status, NS delegation, DNSSEC validity, and whether a recent zone or registrar change correlates. This branch is rarer and almost always self-inflicted.
  4. Verdict: partial or regional. Gather evidence before escalating: affected user’s cf-ray, traceroute, resolver in use, timestamp. That bundle is the difference between a useful support ticket and a week of “cannot reproduce”.
  5. Afterwards, always: write the timeline down. Which check produced the verdict, how long isolation took, what you almost did but did not. The drill only gets fast through repetition and notes.

When this approach is wrong

If the site is not proxied (grey-cloud, DNS-only), this decision tree collapses — Cloudflare is only your DNS publisher and every HTTP failure is yours. If you are behind a Cloudflare Tunnel, “origin reachable directly” is not a testable step; check cloudflared connector health instead. And if the outage is intermittent rather than binary — sporadic 520s, occasional timeouts — you are more likely looking at keep-alive and timeout mismatches than at anyone’s outage; that failure mode is covered in Cloudflare in front of your own load balancer.

Common mistakes

  • Trusting the homepage. Cache serves it beautifully while the application is dead. Always test an uncacheable path.
  • Grey-clouding as a reflex. Origin IP exposed for good, firewall drops visitors, TLS may not even be browser-valid. It is a planned manoeuvre or it is a mistake.
  • Restarting healthy origins during an edge incident, turning zero self-inflicted downtime into some.
  • Testing only from inside the office network. One vantage point cannot isolate anything; the problem may be the office resolver.
  • Skipping the timestamp-and-cf-ray habit. Without them, neither Cloudflare support nor your future post-mortem can reconstruct what happened.

Prevention / maintenance checklist

  • Direct-to-origin probe capability standing ready: allowlisted monitoring host, documented origin IPs, tested quarterly.
  • Dual-path monitoring (proxy and direct) alerting on divergence, so the verdict often arrives before the users do.
  • The grey-cloud go/no-go decision written down with its preconditions, as part of the zone’s rollback plan.
  • Status-page subscription for Cloudflare incidents feeding the on-call channel.
  • Quarterly: run this drill as an exercise and time it; the reference material lives at developers.cloudflare.com/fundamentals/.

A Cloudflare migration with a written rollback plan, or a zone that gets reviewed quarterly instead of drifting — that is the operating discipline Stack Harbor sells under Managed Cloud Ops; book an infrastructure review.