Exceeded the limit of 1,000 worker routes
Anyone know why I would suddenly get this error when there are over 1,300 routes already on the worker?
15 Replies
This is not documented anywhere, and my app is currently broken to new users.
It's documented here https://developers.cloudflare.com/workers/platform/limits/#routes-and-domains
It shouldn't have let you go above it though, unless you had those 1,300 before the limit was in place (1 or 2 years ago at a guess?)
The official process to get it raised is to fill out https://forms.gle/ukpeZVLWLnKeixDu7, but there isn't a guarantee about response times and the docs say to consider using Workers for Platforms instead.
Yeah I see, it actually hit 1,000 exactly.
Thanks. I'll look into that.
Yeah i see the worker has more than 1,000 routes
but the zone does not
Yeah thats right, it looks like can potentially do away with this though if I pay for the workers for platforms
There must be a way to do this without a cap
Workers for Platforms is the solution, you should not have over 1k routes. Even more than a hundred sounds like you're heading in a bad direction
I'm looking into that, but don't I still need to specify which customer routes hit the worker? Even if I am using wildcard subdomains, every customer needs a route, no?
customer.domain.com is CNAMEing to hosting.mydomain.com, and I'm adding a route for the customer.
but are you thinking I can make this work with just one route? the hosting route?
If you're using CF For SaaS, you just use
*/*
https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/start/advanced-settings/worker-as-origin/Cloudflare Docs
Workers as your fallback origin · Cloudflare for Platforms docs
Learn how to use a Worker as the fallback origin for your SaaS zone.
WfP would let you deploy different workers per customer which you execute via binding, ex:
Dispatch worker
*/*
-> uses something like hostname/etc to dynamically call specific user worker
or if it's a single worker for all, just */*
Worth mentioning, as that guide says, */*
will grab everything and you need to exclude your own domain *domain.com/*
if you have any other unused subdomains. I always just tell people to get a seperate domain for CF For SaaS to avoid any issues, since firewall rules/etc apply too, easy to accidentally effect custom hostnames if they use the same domain as your main websiteah
where do you exclude?
you can just make a second worker route with
Service: none
so lets say i dont want the room domain for my main site to hit it
it does seem the asterisk is working across all sites
just might want to handle exlcusions now
room.mainsite.com/* service: none
i see.. and is it not possible to do something like this?
api.*/*
i have a worker for just api routes
how does the worker know what URL to send to the worker though, using the wildcard?
anything resolving to my domain?
i guess i can just move this logic into a single worker
oh anything entering the proxy is going to hit that workerit doesn't change it, it's just whatever it receives
wildcards have to be at the beginning and end