How do I enable our user to add custom domain on our website builder hosted through Worker
We are building a website builder. The output is just html stored in KV and served through Cloudflare worker. Our customer want to add their custom domain. Example: mywebsite.com. How can we do this with Cloudflare DNS API. Is it possible?
I understand that we have to ask the user to add a CNAME or A Record. How to do it so that Cloudflare does automatic SSL.
Any method is appreciate.
2 Replies
CF For Saas is your answer: https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/start/advanced-settings/worker-as-origin/
Cloudflare Docs
Workers as your fallback origin · Cloudflare for Platforms docs
Learn how to use a Worker as the fallback origin for your SaaS zone.
Can via api or dash add each custom hostname, have them cname or use one of the prevalidation ways and then cname, then it auto does ssl for them either via http or txt validation
worth noting though to use CF For SaaS on apex domains (ex: example.com is apex, where www.example.com is a subdomain), you need their DNS Provider to either be Cloudflare or someone who supports CNAME/ALIAS on apex, or Enterprise CF For SaaS w/ Apex Proxying addon