Our customer cannot change its nameservers, but we want to use his domain for our cloudflare worker. We want the domain “www.example.com” to point to the worker, but ideally also the root domain “example.com”.
We found the docs about the partial setup with CNAME-Flattening, but we are unsure if we understand the possible setups correctly. We are aware that this is a bussiness plan and up feature.
Is it possible to just point “www.example.com” to cloudflare workers, without changing the nameservers of the domain? If so, how does this exactly work?
Same thing for the root domain “example.com”, if it is possible (which is vaguely stated in the docs), how do we exactly configure this?
You are correct, you could do the Partial Setup option:
Alternatively, you could deploy the worker to your own website/zone on any plan and then use Cloudflare for SaaS to set up your worker as an origin for any custom hostname you wish to provide that worker to:
If you cannot have the customer redirect the root to a subdomain (e.g. www) themselves then you would need partial setup on the Business plan so that you could either deploy the worker directly to that hostname or use a rule on Cloudflare to do the redirect to your chosen subdomain.
Otherwise, the documentation I linked to covers how to use Cloudflare for SaaS to set things up.
I tried to configure the fallback origin method you linked. I added the “originless” record (192.0.2.0) at my external DNS provider, enabled and configured the Cloudflare SaaS Setup as described in the docs and configured the fallback origin. However traffic is not being routed to my worker. As it is not explicitly stated in the docs: For me it seems like I still would need to move my domains DNS to cloudflare to use the fallback origin method?
A record without an origin has to be created in Cloudflare, not an external DNS provider. The placeholder IPs are not routable and their records must be Proxied.
I also added the record in cloudflare DNS (though I do not understand how that should affect my domain, as my nameservers are still not cloudflare) , still not working. Could you please clarify if the origin fallback setup is possible without changing my nameservers to cloudflare?
I wasn’t suggesting that you should add it in Cloudflare. The important part was that such a record would not do anything useful at another provider. I cannot provide the answer to your fallback origin question. Hopefully someone else will be able to address it for you.