Open garretcharp opened 2 years ago
Howdy @rita3ko, can you help with this?
@tanushree-sharma @kabirsikand what's the right answer here?
cc @dinasaur404
The updated guidance here is to use Custom Domains to route traffic on a zone to the Worker, by setting the custom domain as a fallback origin or custom origin for your custom hostnames (e.g. worker.example.com); this however will also route traffic on that domain name (worker.example.com) to the worker. In that regard it is different than both methods listed on the documentation now.
Even when using custom domains you must still have a route of */*
otherwise you will get the following error (522):
And if you dont want your entire zone to be taken over by the SASS worker you need to add 2 worker exclusions in your zone settings and the */*
route So you would need all of the following:
<zonename>.com/* -> no worker
*.<zonename>.com/* -> no worker
*/* -> sass worker
@kabirsikand is there any update on this? People still get confused by this in the Cloudflare Dev Discord. Would be nice to update docs here to show how to set this up properly and to update that the worker routes page now calls it a "service" in the route selection menu.
Struggled for a day, before finding this issue. Would be great to have this mentioned in https://developers.cloudflare.com/workers/configuration/routing/custom-domains/
Which Cloudflare product does this pertain to?
Cloudflare for SaaS
Existing documentation URL(s)
Section that requires update
Point #4
What needs to change?
It currently states that if you want all traffic on your zone to go to the worker to set a route pattern as
*/*
going to the worker (this part is correct). However it says if you do not want that to set the route*.<zonename>.com/*
to no worker. When in actuality you need to see both the*/*
route to the worker and*.<zonename>.com/*
to no worker otherwise all your customers domains would get error 522.How should it change?
Needs to give accurate info on how to setup the worker origin if you do not want everything on your zone to go to the saas handler worker. Had to debug this quite a bit in discord to get it to properly work because it was either getting error 522 or overriding all of my other workers previously and any other origins that might be setup that proxy through cloudflare.
Additional information
No response