Cname to a subdomain on an (origin-less) Workers route

Hello all,

My setup:
a. Two domains abc.com and xyz.com, both set up in Cloudflare (orange cloud on).
b. subdomain sub.xyz.com, with a Workers Site (running off the *.xyz.com route)
c. xyz.com has an A record that points to 192.0.2.1(ie nowhere, since I’m interested only in running a worker off the subdomain for now.)

What I want :
I’m attempting to cname sub.abc.com to point to sub.xyz.com, such that the Workers Site at sub.xyz.com loads when I visit sub.abc.com.

What happens:

  1. When I access sub.xyz.com from a browser window, the Workers site loads fine.
  2. When I try to load sub.abc.com (which is cnamed to sub.xyz.com), the Workers site does not load, and it attempts to contact the origin server 192.0.2.1 (which fails).

My question :
1.Is there a way to achieve what I want (as described above) by staying within the Cloudflare infrastructure and not having to configure an origin server?
2. Even if I configure a proper webserver at the origin, how should it ideally respond to a request, such that the worker is invoked?

Thanks in advance for your time.

All,

I moved the Worker to the root domain xyz.com

But even this doesn’t work :
sub.abc.com CNAME -> xyz.com

ie A worker on xyz.com loads fine when I visit xyz.com directly in the browser, but does not load when I visit sub.abc.com.

Any pointers?

Cname doesn’t work in a normal account, you need the Cloudflare Enterprise account.

More here:

And: