Wildcard DNS with workers on a custom domain
I found a bunch of discussions, but still confused. I have a worker with a custom domain and a route defined:
And I have the DNS set for
Any request to
My idea was to check the
Developing locally it's a similar story: request to
And I have the DNS set for
AAAA * 100:: ProxiedAny request to
anything.example.com now get routed to the worker and it responds. So that works. I am trying to make my app route to different handlers depending on the subdomain (my SaaS has subdomain per user, and the app is written in Hono). My idea was to check the
Host of the request and make routing based on that. But the Host is always just example.com, without the subdomain, and my in-app routing fails. What am I missing?Developing locally it's a similar story: request to
bla.localhost has a Host value of localhost, not bla.localhost. Running wrangler with --host argument just changes the host, but never fixes the missing subdomain.