Custom Hostname with Worker Environment

Hey folks, how can I use different worker environment with custom hostname setup. As far as I understand we can use a single fallback origin. What's the best way using different workers such as dev, staging and production for a custom domain?
4 Replies
LordNikon
LordNikon•6mo ago
From what I have been able to gather, coming from Pages where each branch was given it's own unique url, set up a worker for each branch and then point the domain to the worker.dev domain. your branches can be auto deployed to a preview url, but each deploy is a new preview url so that automagical stuff doesn't work with workers it seems MAYBE there is an answer lying in environment variables but I'm only like a day into this stuff, learning to solve the same problem too https://developers.cloudflare.com/workers/wrangler/environments/ i have that bookmarked, but I havent figured out if it will help me yet
makrdev
makrdevOP•6mo ago
Thanks! Let me know if you can figure it out 🤜
LordNikon
LordNikon•6mo ago
I was honestly hoping someone else would chime in by now... guess we're on our own

Did you find this page helpful?