Using a Worker as your origin
If you are building your application on Cloudflare Workers, you can use a Worker as the origin for your SaaS zone (also known as your fallback origin).
In your SaaS zone, create and set a fallback origin, but use a “fake” proxied DNS record.
service.example.com AAAA 100::
In that same zone, navigate to Workers Routes.
Click Add route.
Decide whether you want traffic bound for your SaaS zone (
example.com) to go to that Worker:
If yes, set the following values:
*/*(routes everything — including custom hostnames — to the Worker).
- Worker: Select the Worker used for your SaaS application.
If no, set the following values:
*.<zonename>.com/*(only routes custom hostname traffic to the Worker)
- Worker: None