Hi everyone,
I’m trying to configure my Cloudflare Worker so that it runs on all subdomains of my domain (*.mydomain.com) except for a couple of specific subdomains — namely apimydomain.com and id.mydomain.com. For these two subdomains, I want the Worker not to be invoked at all.
I’ve tried:
Using route patterns in wrangler.toml/wrangler.jsonc with empty script fields for those subdomains, but I get errors.
Using _routes.json with exclude patterns, but it doesn’t seem to prevent invocation.
Listing all allowed subdomains explicitly — but this is difficult because there are many dynamic subdomains.
Does Cloudflare Workers routing support excluding subdomains from a wildcard route? If not, what’s the best practice to achieve this? Should I handle this logic inside the Worker code itself by checking the hostname and skipping processing?
Thanks in advance for your help!