One subdomain, multiple workers, different path routes
Hi there - long time lurker but first time poster!
Working on an API, to be exposed at api.mysite.com. I've thought to have two different workers, each one servicing different endpoints, eg. `api.mysite.com/path1` -> `worker-path1` and `api.myseite.com/path2` -> `worker-path2`.
This works fine with custom domains and route paths in the first one, but not the other, since the CNAME is already attached on the first one for the custom domain. This is also described in the docs: https://developers.cloudflare.com/workers/configuration/routing/custom-domains/ but I had missed that, even though it seems to me a very reasonable request.
Is my architecture not possible at all? What would be the best alternative here?
Posted Oct 1, 2025, 9:07 PM UTC
01