How to whitelist cloudflare?

Hello, I have a static website which is hosted on Cloudflare pages which fetches data from my API during the build time. I don’t want my API to be accessible for everyone, but only users who are using our company VPN. This means that Cloudflare will not be able to access my API giving a response with 403 error code for each request. The question would be what IP addresses should be whitelisted in my API server for Cloudflare to be able to access my API? Or maybe there is some other solution?

1 Like

Hello Aurimas.k!

You may find instructions about this here:

Gabriel Frederico

The Cloudflare Pages build process runs on Google Cloud Platform so whitelisting Cloudflare IP addresses won’t help. I’m afraid the best solution is to allow all IP addresses and have proper authentication on the API.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.