Once a hostname is proxied, your uptime monitor no longer measures your server — it measures Cloudflare’s edge, the cache, and your server blended into one number. A cached page can return 200 while the origin is on fire; a Cloudflare hiccup can throw 52x while your origin idles happily. The operational answer is two probe paths — one through the proxy for user experience, one direct to the origin for your responsibility — and an alert that fires on the difference between them, because that difference is the diagnosis.
What’s happening
The proxy blends three failure domains into one URL: DNS and the Cloudflare edge, the cache, and your origin. A single through-the-proxy check cannot tell you which one broke. Worse, caching actively masks origin death: static and cached content keeps serving after the origin stops, so a homepage check can stay green for hours of real outage on every uncached path.
Probing the origin directly restores visibility but creates a leak risk: the whole point of the proxy was to hide the origin IP. Publishing a direct.example.com A record for the monitor to use hands that IP to anyone reading DNS — and if you issue a certificate for the name, to anyone reading certificate transparency logs. The techniques below get the probe through without the leak.
Cloudflare also sells a piece of this: standalone Health Checks (available from the Pro plan up) probe your origin from Cloudflare’s network and notify on failure. Useful — but the probes come from Cloudflare, so they test the origin, not the non-Cloudflare path, and they cannot tell you Cloudflare itself is the problem. They complement external monitoring; they do not replace it.
What to check first
- What your current checks actually hit. If every monitor targets the proxied hostname, you have user-experience monitoring and zero origin monitoring. List them.
- Whether your monitoring can pin an IP. Self-hosted probes (curl in cron, Uptime Kuma, blackbox_exporter) can; several SaaS monitors cannot, which forces the monitoring-hostname pattern with its mitigations.
- The origin firewall. Direct probes must be allowlisted explicitly; if the firewall admits only Cloudflare ranges, your new probe will report an “outage” that is just its own packet being dropped — see allowlisting Cloudflare IPs at the origin firewall.
How to verify
The core trick: curl --resolve pins the hostname to the origin IP for one request — correct TLS name, correct Host header, no DNS record published anywhere:
# Path 1 — through the proxy (user experience)
curl -s -o /dev/null -w 'proxy %{http_code} %{time_total}s\n' \
https://www.example.com/healthz
# Path 2 — direct to origin, no DNS involved
curl -s -o /dev/null -w 'origin %{http_code} %{time_total}s\n' \
--resolve www.example.com:443:<origin-ip> https://www.example.com/healthz
# Prove which path you took: the proxy adds cf-ray, the origin does not
curl -sI https://www.example.com/healthz | grep -ic cf-ray
curl -sI --resolve www.example.com:443:<origin-ip> https://www.example.com/healthz | grep -ic cf-ray
Run both from the same monitoring host on the same schedule. Two numbers, one diagnosis: proxy failing with origin healthy points at the edge or your Cloudflare config; both failing points at the origin; origin failing with proxy green means the cache is flattering you and uncached paths are already broken.
The runbook
- Give the origin a dependency-aware health endpoint.
/healthzshould check the database and critical dependencies, return 200 only when the app can do real work, and be excluded from caching (a cache rule bypass on the path) so the through-proxy probe is never a cache hit. - Set up the direct probe with
--resolve. blackbox_exporter, Uptime Kuma, and plain curl-in-cron all support IP pinning. The probe host must be allowlisted at the origin firewall by its static IP. No DNS record, no certificate issuance, no leak. - If the monitoring SaaS cannot pin IPs, use a monitoring hostname — safely. Create
ops-<random-string>.example.comas a DNS-only record. Accept what this publishes and mitigate: restrict the origin firewall so only the monitor’s published IPs (plus Cloudflare ranges) reach 443, avoid issuing a dedicated certificate for the name if your wildcard already covers it, and treat the obscure name as reduced noise, not security. - Alert on divergence, not just failure. Three rules: origin probe fails — page, it is yours; proxy probe fails while origin is green — check the Cloudflare status page and your recent zone changes before touching servers (the drill is written up in when Cloudflare is down but your site is not); both fail — origin first, it is almost always the origin.
- Add Cloudflare Health Checks as a third opinion if the plan allows. Pro and up. Their value is the notification when Cloudflare’s own probes see your origin die — an early warning that arrives even when your monitoring host is the thing that failed.
- Watch the drift metric. Log both response times. The gap between proxy latency and origin latency is your Cloudflare overhead baseline; when the gap inverts or balloons, something changed at the edge — usually cache hit ratio or a new rule.
When this approach is wrong
If the origin sits behind a Cloudflare Tunnel, there is no direct inbound path to probe — monitor tunnel connector health and an inside-out probe instead. If you run the Load Balancing add-on, its monitors already probe origins from Cloudflare’s side; keep one external direct probe anyway, because the add-on shares Cloudflare’s fate during a Cloudflare incident. And on shared hosting where you cannot allowlist a probe IP, settle for the monitoring-hostname pattern and accept the trade.
Common mistakes
- Monitoring only the homepage through the proxy. Cache keeps it green while every dynamic route 500s. Probe an uncacheable health path.
- Publishing
direct.example.comwith zero mitigations, then wondering how the origin IP ended up in an attack. DNS is public; certificate transparency is public. - Probing an endpoint the firewall blocks and paging the on-call for a self-inflicted timeout. Allowlist the probe host first, then enable the alert.
- Letting the health endpoint lie. A static 200 behind a dead database steers both your alerts and any pool failover into the ditch.
- One monitoring location. A single probe host cannot distinguish “origin down” from “my network to the origin down”. Two locations for the direct probe, minimum, before you page on it.
Prevention / maintenance checklist
- Both probe paths (proxy and direct) running from at least two locations, results graphed side by side.
- Probe-host IPs documented next to the origin firewall rules that admit them.
- Health endpoint reviewed when application dependencies change.
- Quarterly: fire-drill the divergence alerts by blocking each path in a window and confirming the right alert fires with the right runbook link.
- Cloudflare’s own guidance on origin monitoring and health checks lives under 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.