Sergey A
Sergey A
CDCloudflare Developers
Created by Sergey A on 2/4/2025 in #workers-help
The response of a fetch() request in worker is different from same request in any other environment
I have a domain xolotto.com and subdomain blog.xolotto.com managed by Cloudflare. When I make a request from any browser https://blog.xolotto.com I have the response STATUS 200 OK and the content of the test page, which is expected. However when I make a fetch request to the same resource from the worker, the result of the fetch is STATUS 403 UNAUTHORIZED: export default { async fetch(request, env, ctx) { let blogResponse = await fetch("https://blog.xolotto.com") // returns 403 UNAUTHORIZED return blogResponse; }, }; The worker with the code above is deployed here: https://twilight-voice-3b23.xolotto-account.workers.dev/ The issue first showed up about 2 weeks ago. Before that everything was working fine for a few years, no code changes in the worker or test page code. What could cause the issue and how I can fix it? From the worker’s dev tools I cannot know the IP address of the origin server of blog.xolotto.com. Is it possible that the worker resolves DNS lookup to a different IP? The origin server for blog.xolotto.com is Hostinger and they recently changed their IP to 45.80.182.143 and asked to update the DNS A record, which I did in Cloudflare.
15 replies