Page Rules and exclude

Hello! I have a page rule with Disable Cache for my URL: example.com/v1/* for my api. How I can exclude it from Cloudflare? When I make new request at this URL, I receive different ip’s but I have fixed ip address.

As you have discovered, you can use pagerules to customize what behaviours apply to different URLs. Caching is normally a non-issue for any well developed API as the API will use Cache-Control headers (at least, assuming you haven’t set Cloudflare to override/ignore headers), but, you may need to use a page rule to reduce security as a client consuming the API cannot complete JavaScript challenges.

Alternatively, you can create a new A record which is not proxied (:grey:) and points directly to your server. This will require updating your server’s TLS/SSL certificate to include the new hostname as well, and of course as this bypasses Cloudflare you need to consider the security implications of doing so too.

1 Like

This topic was automatically closed after 31 days. New replies are no longer allowed.