【问题标题】:Using Cloudflare CDN + HTTPS with Google Cloud Storage将 Cloudflare CDN + HTTPS 与 Google 云存储结合使用
【发布时间】:2018-09-20 13:54:49
【问题描述】:

我正在尝试弄清楚如何让我的 Google Cloud Storage 存储桶与 Cloudflare 一起使用。我按照https://cloud.google.com/storage/docs/static-website 此处的步骤进行了以下操作:

  1. 添加了一条 cname 记录,用于记录我想在哪里提供我的内容:cdn.test.stellarguard.me -> c.storage.googleapis.com

  2. 为 cdn.test.stellarguard.me 添加了云存储桶

  3. 上传文件并公开: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):

虽然您可以通过 HTTPS 使用直接 URI 来提供您的内容,例如 如,当使用 CNAME 重定向托管静态网站时,云 存储仅支持 HTTP。通过自定义服务您的内容 通过 SSL 的域,设置负载均衡器,使用第三方内容 带有云存储的交付网络,或为您的静态网站提供服务 来自 Firebase 托管而不是云存储的内容。

于是我搜索了一下,看到有人建议开启 Flexible SSL (Use CloudFlare to CDN a Google Cloud Storage Bucket),所以我添加了一个 Page Rule:

*cdn.test.stellarguard.me/* - SSL - 灵活

但是,错误仍然存​​在。有什么想法吗?

【问题讨论】:

    标签: google-cloud-storage cloudflare


    【解决方案1】:

    我的问题与 Google Cloud Storage https 无关——问题是 CloudFlare 免费版不支持多个子域。将其切换到 cdn-test.stellarguard.me 有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-09
      • 2018-10-04
      • 1970-01-01
      • 2017-02-09
      • 2020-09-10
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      相关资源
      最近更新 更多