将Cloudflare CDN + HTTPS与Google Cloud Storage结合使用 [英] Using Cloudflare CDN + HTTPS with Google Cloud Storage
问题描述
我正在尝试弄清楚如何使我的Google Cloud Storage存储桶与Cloudflare一起使用.我按照此处的步骤 https://cloud.google.com/storage/docs/static-网站,并执行以下操作:
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:
-
为要在其中提供内容的位置添加了cname记录:cdn.test.stellarguard.me-> c.storage.googleapis.com
Added a cname record for where I want to serve my content: cdn.test.stellarguard.me -> c.storage.googleapis.com
为cdn.test.stellarguard.me添加了云存储桶
Added a cloud storage bucket for cdn.test.stellarguard.me
上传文件并将其公开: https://storage.googleapis.com/cdn.test.stellarguard.me/logo.svg
Uploaded a file and made it public: https://storage.googleapis.com/cdn.test.stellarguard.me/logo.svg
但是,当我访问 https://cdn.test.stellarguard.me/logo.svg 我看到一个错误,提示SSL版本不匹配.这可能是由于此处提到的内容( https://cloud.google.com/storage/docs/static-website#https ):
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):
虽然您可以使用直接URI这样的HTTPS通过HTTPS提供内容作为,当使用CNAME重定向托管静态网站时,云存储仅支持HTTP.通过自定义服务提供内容SSL上的域,设置负载平衡器,使用第三方内容带有Cloud Storage的交付网络,或为您的静态网站提供服务内容来自Firebase Hosting,而不是Cloud Storage.
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.
因此,我做了一些搜索,发现有人建议打开"Flexible SSL"(
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-灵活
但是,错误仍然存在.有什么想法吗?
However, the error still persists. Any ideas?
推荐答案
我的问题与Google Cloud Storage https没有关系-问题是免费的CloudFlare不支持多个子域.将其切换到cdn-test.stellarguard.me即可.
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.
这篇关于将Cloudflare CDN + HTTPS与Google Cloud Storage结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!