Cloudflare R2 403 on redirect from express JS

When a user asks for a resource, I redirect them to that resource on Cloudflare R2. R2 bucket is behind my own DNS (if that can help or I can change something there).

The issue I am facing is a 403 Forbidden on the preflight. “Request method: OPTIONS”.

did anyone face this issue here ? how can I fix it ?

I tried changing the headers on the DNS level to allow everything, but still can’t figure it out.

Sounds like you haven’t configured CORS on the bucket.

all the headers are there, my issue is, on the backend level, when a user request a document, I redirect them to my R2 bucket file using my own DNS to set the headers.
But the preflights fail (screenshot in copy) it tries to do an “OPTIONS” on the url before requesting the file and it fails.


Okey you were right, I didn’t really had the CORS in place but now behind my own DNS I am getting “204 No Content”, am I forced to use R2 provided DNS by Cloudflare ?