Using Cloudflare CDN + HTTPS with Google Cloud Storage

我与影子孤独终老i 提交于 2021-01-27 23:30:22

问题


I’m trying to figure out how to get my Google Cloud Storage bucket to work with Cloudflare. I followed the steps here https://cloud.google.com/storage/docs/static-website and did the following:

  1. Added a cname record for where I want to serve my content: cdn.test.stellarguard.me -> c.storage.googleapis.com

  2. Added a cloud storage bucket for cdn.test.stellarguard.me

  3. Uploaded a file and made it public: https://storage.googleapis.com/cdn.test.stellarguard.me/logo.svg

However, when I go to https://cdn.test.stellarguard.me/logo.svg I see an error that there’s an SSL version mismatch. This is probably because of what is mentioned here (https://cloud.google.com/storage/docs/static-website#https):

While you can serve your content through HTTPS using direct URI’s such as , when hosting a static website using a CNAME redirect, Cloud Storage only supports HTTP. To serve your content through a custom domain over SSL, set up a load balancer, use a third-party Content Delivery Network with Cloud Storage, or serve your static website content from Firebase Hosting instead of Cloud Storage.

So I did a little searching and saw someone suggested turning on Flexible SSL (Use CloudFlare to CDN a Google Cloud Storage Bucket), so I added a Page Rule:

*cdn.test.stellarguard.me/* - SSL - Flexible

However, the error still persists. Any ideas?


回答1:


My issue had nothing to do with Google Cloud Storage https -- the issue was that CloudFlare free does not support more than one subdomain. Switching it to cdn-test.stellarguard.me worked.



来源:https://stackoverflow.com/questions/49762212/using-cloudflare-cdn-https-with-google-cloud-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!