Use wildcard domain with worker (assets)

I'm trying to make subdomains work with a wildcard. Because worker domains do not support wildcards, I'm just doing it with a DNS entry. This did not work with assets (CORS error) so I added a route rule that adds access-control-allow-origin: * to the response headers. Now, when I go to the subdomain, the assets are loaded but any other request to the domain still return http 522 responses. The domain without the wildcard works just fine. What am I supposed to do to make subdomains work? The project I'm trying to deploy is a nuxt project.
1 Reply
Gerbuuun
GerbuuunOP2w ago
I have two worker domains: - mydomain.com - fallback.mydomain.com (trying out the saas custom domains) and one route: - .mydomain.com the two worker domains work completely fine. the route loads the assets but any other request fails with 522 Ok, I had to change the route to `.mydomain.com/*` obviously 🤦‍♂️

Did you find this page helpful?