How to Restrict Website Origin Access and Prevent Cloudflare Bypass

How should a small business restrict access to its website origin so visitors cannot bypass Cloudflare?

Use Cloudflare Tunnel when the web server does not need to accept public inbound traffic. If public ingress must remain, allow only Cloudflare traffic and require a secret value associated with your own Cloudflare configuration at the origin. Allowlisting Cloudflare addresses by itself is incomplete because another Cloudflare customer could still direct traffic through Cloudflare to the exposed origin. Test the hostname, direct origin path and an unauthorised Cloudflare-routed path before treating the control as effective.

Origin protection means the server accepts web traffic only through Cloudflare or through a private tunnel.
How to Prevent Direct Access to Your Website Origin Server - Libyan Spider Knowledge Base · As of 2026-11-30
Use Cloudflare Tunnel when the origin should not accept public inbound web traffic.
How to Prevent Direct Access to Your Website Origin Server - Libyan Spider Knowledge Base · As of 2026-11-30
Even with a firewall restricted to Cloudflare IP addresses, an attacker could use their own Cloudflare account, point a domain at the origin IP, and send traffic through Cloudflare.
Protecting your website from direct requests that bypass Cloudflare · As of 2026-11-30
Origin header verification can stop attackers who find an origin IP from bypassing Cloudflare WAF rules, rate limits, geographic blocks and bot challenges.
Protecting your website from direct requests that bypass Cloudflare · As of 2026-11-30
A secret token tied to a zone can block the other-account route because only that Cloudflare configuration knows the secret value.
Protecting your website from direct requests that bypass Cloudflare · As of 2026-11-30

Define what origin protection must achieve

Origin protection means the server accepts web traffic only through Cloudflare or through a private tunnel. Set that condition as the outcome to approve, rather than treating a proxied public hostname as proof that every route is closed.

Sources: How to Prevent Direct Access to Your Website Origin Server - Libyan Spider Knowledge Base.

Include the Cloudflare-to-origin connection in the wider encryption review so the selected traffic path and its encryption settings are considered together.

  • Treat the origin as protected only when direct web access cannot serve the site.
  • Identify every legitimate web route before changing access controls.
  • Keep the Cloudflare-to-origin connection in the wider encryption review.

Prefer a private tunnel when public inbound traffic is unnecessary

Use Cloudflare Tunnel when the origin should not accept public inbound web traffic. For a small business, this is the clearest choice when the website can operate without a publicly reachable origin web service. Before a service-affecting change, confirm the provider’s current prerequisites and recovery options in its own documentation.

Sources: How to Prevent Direct Access to Your Website Origin Server - Libyan Spider Knowledge Base.

Check the origin-side encryption decision as part of planning the tunnel path, especially where the current website depends on a different connection arrangement.

  • Choose a tunnel where public inbound web traffic is unnecessary.
  • Avoid exposing a public web listener merely for convenience.
  • Confirm current provider prerequisites before changing the traffic path.

Do not rely on a Cloudflare address allowlist alone

Even with a firewall restricted to Cloudflare IP addresses, an attacker could use their own Cloudflare account, point a domain at the origin IP, and send traffic through Cloudflare. A separate analysis similarly warns that an attacker can use Cloudflare to attack an origin IP through Cloudflare. Keep the allowlist if public ingress is necessary, but treat it as network admission rather than proof that a request belongs to the business.

Sources: Protecting your website from direct requests that bypass Cloudflare; Leveraging Cloudflare Workers to prevent attackers from bypassing your Cloudflare WAF – sandrino.dev.

  • A network source can identify Cloudflare without identifying your zone.
  • Keep network restriction as one layer, not the only layer.
  • Require a separate sign that the request belongs to your configuration.

Add verification tied to your own Cloudflare configuration

Origin header verification can stop attackers who find an origin IP from bypassing Cloudflare WAF rules, rate limits, geographic blocks and bot challenges. Cloudflare Workers can change a request before it is forwarded to the origin. Use a design in which the authorised Cloudflare configuration adds the expected secret value and the origin rejects requests without it.

Sources: Protecting your website from direct requests that bypass Cloudflare; Leveraging Cloudflare Workers to prevent attackers from bypassing your Cloudflare WAF – sandrino.dev.

Use a cautious test-before-enforcement process so a verification mistake does not unexpectedly block legitimate visitors.

  • Make the origin verify a value associated with your configuration.
  • Reject requests that lack the expected value.
  • Test the rule cautiously before enforcing it for all traffic.

Verify the protected path and the blocked bypass paths

A website is not fully protected by Cloudflare if its origin IP address can still be used directly. Verification should therefore show that the normal Cloudflare hostname works while a direct origin route and an unverified route do not serve the website. Test only infrastructure the business owns or is authorised to assess, and define the expected result for each route before beginning.

Sources: How to Prevent Direct Access to Your Website Origin Server - Libyan Spider Knowledge Base.

If the authorised path fails, preserve Cloudflare 5xx response evidence and compare expected and unwanted traffic before deciding whether to enforce or roll back.

  • Test normal hostname access before rejection paths.
  • Test only systems you own or are authorised to assess.
  • Do not approve the change while a bypass route still serves the website.

Record the final access rule and recovery path

A secret token tied to a zone can block the other-account route because only that Cloudflare configuration knows the secret value. Record whether the origin uses a tunnel or restricted public ingress, who owns the change, where verification occurs, and how controlled recovery will be handled. Keep the secret out of the record itself and store only the approved location and responsible owner.

Sources: Protecting your website from direct requests that bypass Cloudflare.

Retain evidence for investigation or recovery, including the approval result and the conditions that would trigger a controlled rollback.

  • Record the chosen origin access model.
  • Name an owner for the verification setting and recovery path.
  • Retain approval evidence without recording the secret itself.

Origin-access decision and bypass acceptance table

Use this decision table to select the origin-access model and identify the evidence needed before approving it. It is a planning aid, not provider-specific deployment instructions.

Access modelUse whenNetwork admissionConfiguration proofApproval check
Private tunnelThe origin should not accept public inbound web traffic.No public inbound web path is intended.Use the authorised private traffic path.Normal hostname works; direct public origin path is unavailable.
Restricted public ingress with verificationThe origin must remain publicly reachable.Limit admission to Cloudflare network traffic.Require the expected secret value associated with your configuration.Normal hostname works; direct and unverified routes do not serve the website.

Confirm current provider prerequisites before a service-affecting change. Record the verification location and owner, but never place the secret value in this worksheet.

When this is not the right approach: Do not use this as a provider-interface deployment guide or as authority to test systems you do not own or administer. Confirm current Cloudflare and hosting-provider requirements before making an irreversible or service-affecting change.

Another perspective

Putting Cloudflare in front of a website is not the same as protecting its origin. A Cloudflare-only network allowlist can still admit traffic routed through another customer's Cloudflare configuration.

What follow-up questions matter most?

Is allowing Cloudflare addresses enough?
No. A Cloudflare address allowlist can reduce ordinary direct access, but it does not identify your own Cloudflare configuration. If public ingress remains, pair the network restriction with verification of a secret value associated with your configuration.
When should we use a private tunnel?
Use a private tunnel when the origin should not accept public inbound web traffic. Confirm the provider's current prerequisites and recovery options before making a service-affecting change.
What proves the origin is protected?
The normal proxied hostname should work. Direct origin access should not serve the website, and requests that do not carry the authorised verification value should be rejected.

What steps does this workflow follow?

Restrict a website origin so Cloudflare cannot be bypassed

  1. Define the accepted traffic path: Decide whether web traffic may reach the origin only through Cloudflare or through a private tunnel, and list every legitimate route that must remain available.
  2. Choose the access model: Use a private tunnel where the origin does not need public inbound web traffic; otherwise retain public ingress only with restricted network admission and request verification.
  3. Add configuration-specific verification: Arrange for the origin to require the expected secret value associated with the business's Cloudflare configuration, alongside its network restriction.
  4. Test before approval: Check the normal hostname, the direct origin path and an unauthorised route, then keep evidence and remediate any route that still serves the site.
  5. Record the operating state: Document the selected path, verification owner, recovery method and the evidence used to approve the restriction.