configure R2 onto public domain without using cloudflare for DNS

i want to configure R2 onto a public domain without having to use cloudflare as a DNS provider. is there anyway todo this ?
5 Replies
Chaika
Chaika5mo ago
Simply put, no. Not at all via R2 Custom Domains You could use a Worker with an R2 Binding, and CF for SaaS with the Worker (https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/start/advanced-settings/worker-as-origin/), as long as you had some domain in Cloudflare that you could use, and then you'd add the subdomain of the real domain you want to use as a Custom Hostname. Downsides being it'd have to be a subdomain or using a DNS Provider which supports ANAMEs/CNAMEs on apex, and you'd be paying a Worker invocation for each request regardless of cache status Alternatively you could add the site using a CNAME setup if you bought Business Plan for it. Depending on what you're trying to do, it may be easiest to just buy a second domain to use as your cdn domain and hook up with the bucket, if you're only using it for assets/downloads
Clearly not B
Clearly not B5mo ago
mmh i see, with the r2 sub domain, does the host name of the incoming request matter? i.e. could i set the cname for a sub domain to the r2 sub domain ?
Chaika
Chaika5mo ago
Yes that won't work, the Custom Domain list is basically an allowlist of hostnames, needs to be on there
Clearly not B
Clearly not B5mo ago
and can i point a cname at a domain that is at cloudflare? i.e. i would use a burner domain to setup the R2 connection, and then point my real sub domain with a cname ot the burner one ?
Chaika
Chaika5mo ago
No that wouldn't work, that's why CF for SaaS exists. But it doesn't interop with R2 Custom Domains, you could use a "burner" domain, CF for SaaS and a Worker bound to the bucket as I described above