So as I am aware already, Render runs its own Cloudflare behind for the static sites so we get all the perks already.
But what if I want to add firewall rules to Cloudflare? I tried to add my own Cloudflare for my static site that is on Render and none of the firewall rules I defined are working. I assume this is happening because Render’s CF takes over.
It’s absolutely possible, we actually have CloudFlare in front of ALL services that are deployed to Render - I actually do this myself. You have to make sure you have your DNS in your own CloudFlare account pointing at the onrender.com address for your site and not the IP address and that you have it set to ‘Proxied’ and it all should just work.
As an example, I have a page rule setup on my own site https://johnb.dev/render which is a CloudFlare rule to redirect to Render.com
That is correct, it will work, but specifically, if you’re using CloudFlare yourself then you have to use the CNAMEs for your account to work. If you enter a CNAME value on the root domain, CloudFlare will say it will use CNAME flattening for you which is what you want.