Cloudflare worker as a proxy to AWS S3 HTML file -...
# workers-help
m
Hello guys, I have issues with the simple Cloudflare worker that acts like a proxy to a single file on a public S3. That worker was working a few months ago and now I need it again, but it doesn't work now... AWS S3 bucket is public, the file is also public, I can access that HTML file directly through the browser (masked bucket name):
https://xxxxxxx.s3.eu-central-1.amazonaws.com/error.html
And my worker is like this
Copy code
addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  return await fetch('https://xxxxxxx.s3.eu-central-1.amazonaws.com/error.html')
}
And once I attach Cloudflare Worker to some routes, those routes returns
Copy code
403 Forbidden
cloudflare
but if I open that worked directly through
xxxxx.workers.dev
domain it's working as expected (HTML from S3 bucket is returned)...Hello guys, I have issues with the simple Cloudflare worker that acts like a proxy to a single file on a public S3. That worker was working a few months ago and now I need it again, but it doesn't work now... AWS S3 bucket is public, the file is also public, I can access that HTML file directly through the browser (masked bucket name):
https://xxxxxxx.s3.eu-central-1.amazonaws.com/error.html
And my worker is like this
Copy code
addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  return await fetch('https://xxxxxxx.s3.eu-central-1.amazonaws.com/error.html')
}
And once I attach Cloudflare Worker to some routes, those routes returns
Copy code
403 Forbidden
cloudflare
but if I open that worked directly through
xxxxx.workers.dev
domain it's working as expected (HTML from S3 bucket is returned)... Attached pics: First pic - workers.dev - working Second pic - real domain - not working Third pic - source code of the worker