We have a Worker with the wildcard for the hostname in the routes in wrangler.toml:
routes = [
{ pattern="*/*", zone_id="xxxxxx" }
]
The reason we have this setup is that we wanted the worker to trigger for our clients’ custom domains dynamically connected via Cloudflare for SaaS.
e.g.
example.org -> our domain
client1.org CNAME cname.example.org -> client1 domain connected to ours
client2.org CNAME cname.example.org -> client2 domain connected to ours
The worker used to trigger for requests to example.org
, client1.org
& client2.org
. Recently, when publishing the Worker via Wrangler 2.12, we started to experience the error :
✘ [ERROR] Invalid URL
The more recent Wrangler versions also produce the same error.
What is the recommended Wrangler routes setup for the worker to trigger for every dynamically connected custom domain?