简体   繁体   English

您可以更改 Google Cloud Storage 上文件的公共 URL 吗?

[英]Can you change the public URL of a file on Google Cloud Storage?

I'm storing a series of html files in a GCP bucket, and want to share a minified link for social media purposes.我在 GCP 存储桶中存储了一系列 html 文件,并想分享一个缩小的链接用于社交媒体目的。 Trouble is, the minified link contains the full-length Public URL for redirection purposes, so at the moment the storage.googleapis.com url shows up on those social media cards.问题是,缩小的链接包含用于重定向目的的全长 Public URL,因此目前storage.googleapis.com url 出现在这些社交媒体卡片上。

Ideally I'd like it to show the minified url, but at the very least I'd like to change the Public URL in GCP to something more human-accessible.理想情况下,我希望它显示缩小的 url,但至少我想将 GCP 中的公共 URL 更改为更易于访问的内容。

You have 2 ways to serve a website from Cloud Storage and to customize the URL.您有 2 种方法可以从 Cloud Storage 为网站提供服务并自定义 URL。

  • First, if you want to serve your traffic ONLY in HTTP, you can follow this part of the documentation .首先,如果您只想在 HTTP 中为您的流量提供服务,您可以按照文档的这一部分进行操作。 It
  • Second, if you want to serve in HTTPS (and optionally also in HTTP) you need a LoadBalancer.其次,如果您想在 HTTPS(以及可选的 HTTP)中提供服务,您需要一个 LoadBalancer。 The documentation explains the set up.文档解释了设置。

So when you're setting up you your domain you can use a CNAME record to point to redirect to google bucket因此,当您设置您的域时,您可以使用 CNAME 记录指向重定向到谷歌存储桶

this answers it pretty clearly - https://stackoverflow.com/a/18650641/6147146这很清楚地回答了它 - https://stackoverflow.com/a/18650641/6147146

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

相关问题 您可以将 URL 参数传递给 Javascript 文件吗? - Can you pass URL parameters to a Javascript file? 如何将 URL 直接获取到 IBM Cloud Object 存储上具有访问密钥 ID 和秘密访问密钥的文件 - How to get a direct URL to a file on IBM Cloud Object Storage that has access key id and secret access key Google云存储:获取上传链接(JAVA) - Google cloud storage : get upload link (JAVA) 谷歌URL更改 - google URL change 从Google Storage签名的网址获取存储路径 - Get storage path from Google Storage signed url 如何使用 Firebase/Google 云功能接收 Apple 的订阅状态 url 通知? - How can I use Firebase/Google cloud functions to receive Apple's subscription status url notifications? API Base URL 用于谷歌云 SQL - API Base URL for Google Cloud SQL 我可以在不丢失域功能的情况下将 WordPress URL 更改为 Google 域 URL 吗? - Can I change a WordPress URL to a Google Domain URL without losing domain email functionality? 您可以在 Google+ html 源代码中看到以 // 开头的那些 URL 是什么? - What are those URL's that are starting with // - that you can see within Google+ html source? 不能更改网址,更改php中的网址 - can't change url , change url in php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM