How do I monitor a website that's behind Cloudflare?
Quick answer
How do I monitor a website that's behind Cloudflare?
Monitor the public hostname to test the visitor path. If a CDN or WAF challenges automation, use a narrowly scoped, documented exception approved by the security owner; do not expose the origin.
- An origin-only check and a public-hostname check answer different questions; use both only when each has a clear operational purpose.
- If you use a header or allowlist, keep it narrowly scoped, rotate any secret, and verify that it does not bypass protections for general traffic.
- Challenge and bot-mitigation rules can affect synthetic monitors, so document the exception and test it after WAF changes.
- CDN-specific response codes are diagnostic signals, not a complete root-cause analysis; inspect the associated request and origin logs.
Step-by-step
- 1Document the monitoring path
Decide whether the check should represent public traffic, origin availability, or both, and record the purpose of each URL.
- 2Create a narrow exception if needed
Have the security owner implement and review the smallest safe exception needed for the monitor; do not put a shared secret in a public URL.
- 3Point at the intended hostname
Use the public hostname when the goal is to validate the visitor path, including DNS, CDN and WAF behaviour.
- 4Investigate with context
Use CDN response codes as a starting point and correlate them with request IDs, logs and a second independent observation.