简体   繁体   English

使用带有自定义域的私有谷歌云存储

[英]Using a private google cloud storage with a custom domain

I have an google cloud storage buckets and one rails app to access this buckets.我有一个谷歌云存储桶和一个 Rails 应用程序来访问这个桶。 My app works with files from 1M until 300M in uploads/downloads.我的应用程序在上传/下载中处理从 1M 到 300M 的文件。 On my rails app I use carriewave gem, so...all the throughput comes to my app, after to the bucket....until now, everything normal.在我的 Rails 应用程序上,我使用 carriewave gem,所以......所有的吞吐量都来自我的应用程序,然后是存储桶......直到现在,一切正常。

Recently I implementGCP direct upload but, the base url is storage.googleapis.com.最近我实现了GCP 直接上传,但是基础 url 是 storage.googleapis.com。 This is terrible for my customers that have such a high level security in their local networks.这对于在本地网络中具有如此高级别安全性的客户来说是可怕的。

I need that storage.googleapis.com becomes storage.mycustomdomain.com.我需要 storage.googleapis.com 变成 storage.mycustomdomain.com。 In this approach my customers will just allow *.mycustomdomain.com in their networks.在这种方法中,我的客户将只允许在他们的网络中使用 *.mycustomdomain.com。

Someone could help me?有人可以帮助我吗? Tnks Tnks

Cloud Storage public objects are served directly from GCP through storage.googleapis.com , as explained in the documentation . Cloud Storage 公共对象通过storage.googleapis.com直接从 GCP 提供,如文档中所述。 From John Hanley's comment, and according to this guide , Cloud Storage does not directly support custom domains:根据 John Hanley 的评论,根据本指南,云存储不直接支持自定义域:

Because Cloud Storage doesn't support custom domains with HTTPS on its own, this tutorial uses Cloud Storage with HTTP(S) Load Balancing to serve content from a custom domain over HTTPS.由于 Cloud Storage 本身不支持具有 HTTPS 的自定义域,因此本教程使用具有 HTTP(S) 负载平衡的 Cloud Storage 通过 HTTPS 提供来自自定义域的内容。

The guide goes into creating a load balancer service which you can use to serve user content from your own domain, using the buckets as the service backend.该指南介绍了创建负载均衡器服务,您可以使用该服务为您自己的域中的用户内容提供服务,使用存储桶作为服务后端。 Otherwise, it is also possible to create a CDN which is supported by Cloud Storage and uses a custom domain, as mentioned by the blog objectives:否则,也可以创建受 Cloud Storage 支持并使用自定义域的 CDN,如博客目标所述:

  • I want to serve images on my website (comparison for contact lenses) from a cloud bucket.我想在我的网站上提供来自云存储桶的图像(隐形眼镜比较)。
  • I want to serve it from my domain, cdn.kontaktlinsen-preisvergleich.de我想从我的域 cdn.kontaktlinsen-preisvergleich.de 提供它
  • I need HTTPS for that domain, because my website uses HTTPS everywhere and I don't want to mix that.我需要该域的 HTTPS,因为我的网站在任何地方都使用 HTTPS,我不想混用它。

This related thread also mentions implementation of a CDN to use a custom domain to serve Cloud Storage objects.这个相关线程还提到了使用自定义域来服务云存储对象的 CDN 实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM