Behind Cloudflare
Many sites keep Cloudflare's proxy (the orange cloud) switched on in their DNS. Requests then reach the sentry from Cloudflare's own addresses instead of the visitor's. Without help, the sentry sees only Cloudflare: verified crawlers like Googlebot look unverified, and rate limits, country rules, the deny list, Captcha Protection and Logs all act on Cloudflare's addresses.
Behind Cloudflare fixes that for a domain. When it is on, the sentry reads each visitor's own IP address from the CF-Connecting-IP header that Cloudflare adds, so every rule and log uses the visitor's address.
Only from Cloudflare's ranges
The sentry only reads the header from connections that come from Cloudflare's published IP ranges. stillorigin downloads that list every day and keeps the last good copy if a download fails. A request from anywhere else that sends the same header is ignored, and the sentry uses its real address as usual.
Turning it on
- In the portal, open the domain and choose Edit.
- In Behind Cloudflare, choose Turn on.
Only the host can change it. It is off by default.
Visitors who reach the sentry directly, not through Cloudflare, keep working as before and are checked by their own address, unless you also turn on Only accept traffic from Cloudflare.
What it covers
- Plain HTTP and inspected HTTPS (Website protection on, with the origin's certificate on the sentry): every rule uses the visitor's address. That includes verified crawlers, Captcha Protection, rate limits, country rules, the deny list, Identified traffic blocks, URL rules, the WAF and Logs.
- HTTPS passed through unopened (Website protection off, or no certificate on the sentry): the sentry can't read the request, so the origin and the sentry still see Cloudflare's addresses. Per-visitor protection there relies on Cloudflare.
The firewall and Cloudflare
The firewall works before any request is read, so it can't tell which domain a connection is for. While any domain on a cluster is behind Cloudflare, web traffic from Cloudflare's ranges skips the firewall's per-visitor rules: the deny list, temporary bans, Identified traffic blocks, country blocks, and the crawler, per-network and per-address limits. Otherwise one busy Cloudflare address, which carries many visitors, would be limited or banned for all of them.
Cloudflare's addresses still have a much higher safety limit, so nobody can flood the cluster by sending traffic through their own Cloudflare account. A connection over the limit is dropped, and a Cloudflare address is never banned. On other traffic from those addresses, the deny list and temporary bans still apply.
For domains behind Cloudflare, the sentry applies the deny list, the host's Identified traffic blocks and network-wide country blocks to the visitor's address instead, on plain HTTP and inspected HTTPS. In log mode a deny list match is recorded under Would have blocked and the request is let through.
Other domains on the cluster that aren't behind Cloudflare don't trust the header. If requests for them arrive from Cloudflare, the sentry's per-address request limits apply to Cloudflare's own address.
Some things still only work in the firewall, so they don't stop a visitor who comes through Cloudflare:
- temporary bans (from the firewall's limits or URL rules);
- the firewall's connection, crawler and per-network limits, other than the safety limit above.
The sentry's own per-address request limits (the 429 response) still apply to each visitor on plain HTTP and inspected HTTPS. On domains with Website protection, images, CSS, JavaScript and fonts aren't counted in the page limit; they have a looser limit of their own. On domains without Website protection, plain HTTP from Cloudflare gets the same per-address request limit. HTTPS that passes through unopened only has the safety limit.
Only accept traffic from Cloudflare
Cloudflare recommends that a proxied site only accepts traffic from Cloudflare. Otherwise anyone who finds the sentry's address can skip Cloudflare's own protection by connecting to it directly.
With Behind Cloudflare on, the host can also turn on Only accept traffic from Cloudflare for the domain. It is off by default, and turning off Behind Cloudflare turns it off too. Requests for the domain that don't come from Cloudflare's ranges are then refused:
- Plain HTTP and inspected HTTPS: the visitor gets the blocked page, logged as Not through Cloudflare (
cloudflare-only). - HTTPS passed through unopened: the connection is closed before it reaches the origin. It isn't shown in Logs.
Certificate checks always get through, so the origin keeps renewing its certificate: ACME (/.well-known/acme-challenge/), /.well-known/pki-validation/ and ACME TLS-ALPN-01.
In log mode, plain HTTP and inspected HTTPS requests are recorded under Would have blocked as Not through Cloudflare, and let through. HTTPS that passes through unopened isn't closed. That lets you check nothing you need would be refused before you switch log mode off. Domains without Website protection have no log mode, so the setting applies to them straight away.
Before you turn it on, make sure everything that should reach the site goes through Cloudflare. That includes uptime monitors, payment and webhook callbacks, and any record in your DNS that isn't proxied (grey cloud) but points at the sentry for this domain.