Error 522 when trying to setup a vanity domain via cf for saas

Hey I'm trying to setup vanity domains for my pages project, so that customers can use their own domain instead of a subdomain of my domain. I've added a custom domain in the SSL cf for saas panel (screenshot) but accessing this domain gives me a 522 error. How can I fix this? I've added the CNAME on the vanity domain to point to my fallback origin configured in the cf for saas panel
8 Replies
Walshy
Walshy13mo ago
You can't layer ssl for saas on top of ssl for saas Add the domains to Pages instead
philbookst
philbookst13mo ago
but then it prompts me to add the domain to cloudflare dns, but i dont own the domain i'm building a saas product where a customer can use his own custom domain instead of a subdomain of my pages domain
Walshy
Walshy13mo ago
Yeah you don't need to
philbookst
philbookst13mo ago
ok but what do I need to do?
philbookst
philbookst13mo ago
I get this panel after adding the domain, and when i click the button it redirects me to the normal Site add where I also need to select a plan and change the nameservers
Walshy
Walshy13mo ago
Ah due to being an apex I'd recommend just using the API - https://developers.cloudflare.com/api/operations/pages-domains-add-domain For non-apexes you just select the "external DNS provider"
philbookst
philbookst13mo ago
oh that worked! thank you very much! i was even able to use a subdomain of my pages project (app.example.com) as a cname value to make it look nice
Tobias
Tobias13mo ago
@philbookst I am trying something similar, and was also looking at Cloudflare Saas solution. But how did you use your own subdomain as the cname value instead of *.pages.dev?