Hello!

Hello! Having an issue trying to set up routes in wrangler.toml I want to set both the custom domain and also the wildcard routes but I can't Example of what I'm seeking:
# wrangler.toml
[env.production]
vars = { ENVIRONMENT = "production" }
routes = [
{ pattern = "sub.mysite.io/*", zone_name = "mysite.io" },
{ pattern = "sub.mysite.io", zone_name = "mysite.io", custom_domain = true },
]
# wrangler.toml
[env.production]
vars = { ENVIRONMENT = "production" }
routes = [
{ pattern = "sub.mysite.io/*", zone_name = "mysite.io" },
{ pattern = "sub.mysite.io", zone_name = "mysite.io", custom_domain = true },
]
What is the correct syntax ? The documentation doesn't mention both use cases together (custom domain and wildcard on subdomains); but the only way is to manually edit on the dashboard it seems ?
1 Reply
rufi
rufiOP3mo ago
I think I found the problem. I had a previous version of the worker that specified the custom domains. but if I only do { pattern = "sub.mysite.io/*", zone_name = "mysite.io" }, it seems to work fine (may not need to specify the custom_domain one in this case)
Want results from more Discord servers?
Add your server