Cloudflare Pages + Custom Hostnames for SaaS not working

Hello,

My app is hosted on Cloudflare Pages, and I’m attempting to create vanity domains for my clients using Custom Hostnames for SaaS. However, when I set the fallback origin to myapp.domain.com, it doesn’t work, and I encounter a connection timeout error (Error code 522). Surprisingly, when I change the fallback origin to myapi.domain.com, which is hosted on AWS, everything functions correctly. I was wondering if the community or the Cloudflare support team could provide any assistance with this issue, please?

Thank you,
Zak

Cloudflare Pages itself uses Cloudflare for SaaS under the hood. You can add your customer domains to the Pages site directly if they are all subdomains and they fit under the Pages Custom Domains Limit (varies per plan: Limits · Cloudflare Pages docs), otherwise I believe the only other workaround is using a normal Worker to proxy/fetch your Pages site, and then using the Worker as your origin: Workers as your fallback origin · Cloudflare for Platforms docs