I'm trying to use Cloudflare to provide https access to an s3 bucket. I've setup the CNAME entry in Cloudfront with pointing to the bucket and I've verified I can access it via http but when I try and access the contents with https, I get a 521 error saying the server i.e. bucket is unavailable.
Is it possible to front an s3 bucket with https through cloudflare or is it being blocked?
Do you use Cloudflare with "Flexible SSL" or "Full SSL"?
For "Full SSL", this works for me:
Try following this guide https://support.cloudflare.com/hc/en-us/articles/200168926-How-do-I-use-CloudFlare-with-Amazon-s-S3-Service-
You should have an Amazon Bucket URL that is e.g. https://cdn.example.com.s3.amazonaws.com and you actually want https://cdn.example.com
Do not attempt to do anything with the S3 static configuration or try to use the URLs, just leave that switched off
The https link should give you an "Untrusted connection" error in the browser. Because with "Full SSL", Cloudflare doesn't validate the cert, you can set up a CNAME as described in the guide and have your SSL working fine in the browser then.
Of course with Full SSL on Cloudflare, using https for your actual website means you need a cert on your own server aswell.