Is it possible to use cloudflare for SaaS with cloudflare pages site?

Is it possible to use cloudflare for SaaS with cloudflare pages site?
11 Replies
Chaika
Chaika3mo ago
No. Pages uses Cf for SaaS under the hood, and you can't stack it. That's the short answer. Longer answer is you can use CF for SaaS pointing to a worker/with a worker as origin which fetches your site, but you'd be paying for Worker Invocations on each request. Can you not add the Custom Domains directly to the Pages Project?
Oren
Oren3mo ago
@Chaika thanks for the answer! I'm planning to create a blog platform which should allow my customers to add their custom domains so I serve their blog on customer1.myblogsaas.com and they should be able to cname their customer1.com domain to this subdomain and get ssl issued for them is this scenario still possible with the solution you mentioned without customers having to point their custom domains to cloudflare first?
Chaika
Chaika3mo ago
If you use a CF for SaaS and a Worker proxying to Pages with Worker as Origin, they could CNAME to your domain and you'd have no limit on custom domains except your wallet But you'd be paying for each request as a worker invocation
Chaika
Chaika3mo ago
The only way around that is to use Custom Domains directly in your Pages Project, but then you are subject to your plans limit, and they would need to CNAME directly to your pages project
No description
Oren
Oren3mo ago
got it thanks again Chaika!
rob
rob3mo ago
are there any plans to doing a pages for platforms type of thing? If iw anted our users to be able to host static html we'd want to use pages but as said the limit.. and workers charges per request so that would add up..
Chaika
Chaika3mo ago
there's not been any talk of that I've heard. Pages under the hood uses CF for SaaS so there's no limitation there, and Enterprise can just ask for more. If you want your users to host static html you'd probably want different projects. The Custom Domain limit is per-project, so it's unlikely you'd hit that even on free, and the max projects limit is soft, you can ask for it to be raised even as non-enterprise.
rob
rob3mo ago
ah i see, so if we wanted users to host their static html we could host it on our CF account on pages and just give them access? itll be their own "project" ? trying to avoid paying for al the worker invocations if all it's doing is fetching a static html from KV or a file from pages so we can use the API to make a new pages project per customer and store ther files?
Chaika
Chaika3mo ago
You wouldn't be able to directly give them access in CF, would have to build your own dash that funnels all requests through the API, and you'd have to reverse engineer the upload endpoint as others have in the past, but yea. Although I'm curious why people would use you rather then CF directly if they were hosting just static assets
Aswin Kumar
Aswin Kumar3mo ago
That's because they dont want to host just static assets. Like the OP said earlier, it is a blogging platform. Users may not care if it is hosted static or dynamic. They just want to write a blog. If there is a great UX for writing a blog, and posting it without all the frills, users will choose the blogging platform rather than going through the learning curve of understanding and hosting jamstack.
rob
rob3mo ago
yah for my use case, Ad Lab, we're a PPC marketing tracking platform, but we alos let users upload their landing pages and we want to host them via clodulafe pages as static html