I recently added Custom Domains to my two Workers, and everything seemed to go smooth.
I then noticed some strange behaviour. My Worker started appearing on multiple paths/directories of my domain, and I can easily reproduce this issue.
The steps to reproduce are:
- Close Chrome/Browser
- Open Chrome/Browser
- Go to
bfstats-api.leonlarsson.comand see the API response
- Go to
leonlarsson.com/projects, etc. (either on the same tab or a new tab), and see the same API response.
None of the URLs in step 4 should show a JSON response. The JSON response is what my Worker produces.
This is the Custom Domains setup for my Worker:
The Worker is accessible at that link.
This is the DNS setup for the
leonlarsson.com domain: https://i.imgur.com/m0DoFEh.png
And yet when I reproduce this issue, the logs from my Worker indeed show that the URL triggering it is not tied to my Worker’s Custom Domain: https://i.imgur.com/WIQeMlO.png
I can also reproduce this on my other Worker:
api.onlyraccoons.com, then go to
This is the DNS for
onlyraccoons.com have any Page Rules.
This is the code running on the Worker with the Custom Domain “
bfstats-api.leonlarsson.com”: GitHub Repo
I would appreciate any help I could get. Thanks!
(Sorry, could only embed one image, and couldn’t have more than 4 links)