Only allow Cloudflare access to Netlify site?

I’ve got a Netlify site I only want to be accessible via Cloudflare because I’m using Cloudflare Zero Trust Access. However, at the moment it’s trivial to bypass by accessing my Netlify site directly after looking up my DNS records.

Is it possible to restrict access to my site from Cloudflare via their IP range or some other way?

@almostravioli This Stack Overflow answer appears applicable:

https://stackoverflow.com/questions/75021799/allow-only-cloudflare-ip-into-netlify

It links to this blog post:

The caveat being that it’s for Enterprise Customers.

If that’s not applicable, you may be able to create your own implementation using Edge Functions:

1 Like

Thanks for the links!

Yeah not an enterprise customer. Might just deploy the site on cloudflare pages instead to avoid having to develop a custom solution as you suggested.

@almostravioli Awesome, whatever is easiest!