Pass headers to AWS S3 bucket to fix CORS


I am currently trying to get Cloudflare cache to stop stripping and/or pass the headers to my AWS S3 bucket. I have an app that crops an image that’s uploaded to the S3 bucket. When using Cloudflare, since the headers get stripped and not passed, there is a CORS issue.

I have already confirmed the headers I need are set with both my app’s origin as well as the S3 bucket origin. And I am able to get this working correctly when using Amazon’s CloudFront. As I can whitelist those headers as shown in the attached image.

How would I be able to do something like this with Cloudflare in order to prevent the CORS issue? I have already reached out to CF support, but they keep claiming I need the headers set at the origin, which I already do. Any tips would be most appreciated. Thanks!

Cloudflare does not strip the Origin header. In fact, getting Cloudflare to ignore that header is something that is often requested. The cache Varys with the Origin request header.

Do you have an example cURL request I can use to replicate your issue?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.