> Is there any issue with this approach

Is there any issue with this approach? I want to try it out and am getting CNAME Cross-User Banned when I load the domain the customer uses.
CF Pages uses CF for SaaS under the hood, which basically has an allowlist of all the accepted host headers/subdomains allowed to use it. It's seeing example.customer.com and saying "hey that's not on our list", and it would only allow it as a Verified Custom Domain if it was pointing direct Your options basically are: 1. Use CF Pages Custom Domains up to the limit: https://developers.cloudflare.com/pages/platform/limits/ (depending on plan), have customers cname to pages.dev 2. Use Cf for SaaS, but in order to do that you'd need to have a Worker in the middle and pay for each request as an invocation. Snippets (Workers with more limits, limited to Pro, but no per request costs) may help with this but they're in Alpha/not recommended for production and still rolling out
4 Replies
busterroni
busterroni5mo ago
can you link docs for #2 please?
Chaika
Chaika5mo ago
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.
busterroni
busterroni5mo ago
cloudflare workers that send the user to cloudflare pages I think
Chaika
Chaika5mo ago
just a really simple worker like this will do:
export default {
async fetch(request, env, ctx) {
var incomingRequest = new URL(request.url);
incomingRequest.hostname = "yourpagesproject.pages.dev";
return fetch(incomingRequest, request);
},
};
export default {
async fetch(request, env, ctx) {
var incomingRequest = new URL(request.url);
incomingRequest.hostname = "yourpagesproject.pages.dev";
return fetch(incomingRequest, request);
},
};
of course you'd need more complex routing if you have more then one pages project. You could store the list somewhere else, or have them point at your domain on a subdomain with the same name as the pages project, etc
Want results from more Discord servers?
Add your server