Request to URL on the same zone but in CNAME configuration
Hello, I have a weird behavior that I have an hard time debugging.
I reach out my worker via my custom domain, this worker is actually doing a fetch to another endpoint on a different domain but same zone.
like Worker is: xxxx.plop.com and I fetch from this worker to yyyy.plop.com
And when I do that the fetch is clearly not working all the time.. like a weird resolving issue.
If I access the worker from the route "worker.dev" it's working 100%
i have plenty of debug the fetch is just empty OR sometime it says: "Invalid Link"
Any hint ? or way to debug more?
Thanks
3 Replies
it's like really easy for me to reproduce. Via the customer domain it seems to be another server responding.
#pleasehelp
honestly I am pretty convinced it's a dns resolution issue. But I don't get why it would work on worker.dev. And how to fix it.
This is just normal Worker behaviour, they can’t do same-zone fetch.
Even with custom domains, it tends to be buggy.
oh really? where is that written? I mean I would have loved to know that
hey @kian how would you fix that then, I should create another domain and reach out to it, no other trick?
so if I understand correctly the behavior changes based on how the worker is reached?
hello here, anyone? looking at that documentation: https://developers.cloudflare.com/workers/configuration/routing/custom-domains/#:~:text=On%20the%20same%20zone%2C%20if,succeed%20without%20a%20service%20binding.
nothing mentions that it should not work, on the contrary. However I am pretty confident saying that our work when reached on a custom domain cannot fetch another same-zone domain. DNS resolution is wrong