How to add custom hostname for multi tenant application with cloudflare pages ?
In order to have multi tenant support for cloudflare pages I followed this steps.
Step 1:
Deploy the application to cloudflare pages and set custom domain
Step 2:
Wrote a simple cloudflare worker proxy
Step 3:
Added the worker route as on different domain
I chose a seperate domain for multi tenant apps, so that its easier to maintain the CNAME if later on I wanted to add subdomains to my primary domain
Another reason was that having a seperate domain makes it easier to have a proxy worker route for only purpose of multitenant.
( Please do suggest if there is a better approach, if I could use the existing domain for this)
Now From this step onwards, things are getting a little of confusing to me
Step 4:
I added a wildcard record to
Step 5:
Enabled Custom Hostnames for
Step 6:
Added custom hostname
Step 7:
I didnt understand this part
Step 1:
Deploy the application to cloudflare pages and set custom domain
app.mycompany.comStep 2:
Wrote a simple cloudflare worker proxy
Step 3:
Added the worker route as on different domain
mycompany.site*.mycompany.site/* I chose a seperate domain for multi tenant apps, so that its easier to maintain the CNAME if later on I wanted to add subdomains to my primary domain
mycompany.comAnother reason was that having a seperate domain makes it easier to have a proxy worker route for only purpose of multitenant.
( Please do suggest if there is a better approach, if I could use the existing domain for this)
Now From this step onwards, things are getting a little of confusing to me
Step 4:
I added a wildcard record to
mycompany.site DNSAAAA * 100:: Proxied Step 5:
Enabled Custom Hostnames for
mycompany.siteStep 6:
Added custom hostname
example.com Step 7:
I didnt understand this part
