我正在尝试弄清楚如何让我的 Google Cloud Storage 存储桶与 Cloudflare 配合使用。我按照这里的步骤操作https://cloud.google.com/storage/docs/static-website https://cloud.google.com/storage/docs/static-website并做了以下事情:
为我想要提供内容的位置添加了 cname 记录:cdn.test.stellarguard.me -> c.storage.googleapis.com
为 cdn.test.stellarguard.me 添加了云存储桶
上传文件并将其公开:https://storage.googleapis.com/cdn.test.stellarguard.me/logo.svg https://storage.googleapis.com/cdn.test.stellarguard.me/logo.svg
然而,当我去https://cdn.test.stellarguard.me/logo.svg https://cdn.test.stellarguard.me/logo.svg我看到一条错误,表明 SSL 版本不匹配。这可能是因为这里提到的(https://cloud.google.com/storage/docs/static-website#https https://cloud.google.com/storage/docs/static-website#https):
虽然您可以使用直接 URI 通过 HTTPS 提供内容,例如
例如,当使用 CNAME 重定向托管静态网站时,Cloud
存储仅支持HTTP。通过自定义方式提供您的内容
通过 SSL 的域、设置负载均衡器、使用第三方内容
具有云存储的交付网络,或为您的静态网站提供服务
来自 Firebase 托管而不是云存储的内容。
所以我做了一些搜索,看到有人建议打开灵活的 SSL (使用 CloudFlare 对 Google 云存储桶进行 CDN https://stackoverflow.com/questions/35116278/use-cloudflare-to-cdn-a-google-cloud-storage-bucket),所以我添加了一条页面规则:
*cdn.test.stellarguard.me/*
- SSL - 灵活
但是,错误仍然存在。有任何想法吗?
我的问题与 Google Cloud Storage https 无关——问题是免费的 CloudFlare 不支持多个子域。将其切换到 cdn-test.stellarguard.me 有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)