Point external domain to Cloudflare domain that runs a worker

I’ve added DNS records to an external domain, so it points a Cloudflare domain running a worker.

page in CNAME myworkerdomain.com

I’m trying to read the host header from a worker and use it to get contents from a cloud storage provider, but it only runs if I request the domain the worker is on directly.

It doesn’t run requesting page.myexternaldomain.com. It this because of how it they work with routing zones?

If so, is there a way to run a worker by pointing an external domain to it? A proxy server in front of the worker could work, but that kills the idea of responding from the edge.

Thanks,

Tim

page is the record of your Cloudflare domain and workerdomain the external non-Cloudflare domain, correct?

In that case the worker should get executed as long as page is :orange:.

What is the page.myworkerdomain about though? page is not a host of that domain, right?

Sorry I messed up removing links since I had 2 link limited. page is a record of myexternaldomain, and myworkerdomain is Cloudflare domain running a worker.

So that page record is part of that external domain? That would not work, as you’d resolve the host to Cloudflare’s network, however Cloudflare does not know that external domain and will reject that request.

In that case you wouldnt need a CNAME but a proper HTTP redirect to your Cloudflare domain.

1 Like

I was afraid so, makes sense. Thanks for clarifying!