0

I'm storing a series of html files in a GCP bucket, and want to share a minified link for social media purposes. 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.

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.

crevulus
  • 1,658
  • 12
  • 42
  • Do you want to change only the hostname, or also the target name of the minified files? – guillaume blaquiere Oct 15 '21 at 18:39
  • Just the host name, I think? The minified url we can change on bitly. So instead of showing `storage.googleapis.com/{filepath}` I'd like to change it to `my-chosen-url/{filepath}` – crevulus Oct 15 '21 at 19:05
  • Do you want to serve the file in HTTPS or in HTTP only? – guillaume blaquiere Oct 15 '21 at 22:01
  • @guillaumeblaquiere would you mind explaining the difference and/or how either can solve the problem? I can offer both options to my coworkers and see what they think. – crevulus Oct 17 '21 at 08:16

2 Answers2

3

You have 2 ways to serve a website from Cloud Storage and to customize the URL.

  • First, if you want to serve your traffic ONLY in HTTP, you can follow this part of the documentation. It
  • Second, if you want to serve in HTTPS (and optionally also in HTTP) you need a LoadBalancer. The documentation explains the set up.
guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • 1
    This problem has become a non-issue so I haven't had a chance to test your answer. I've upvoted for now and hope to be able to test it in future. Thanks for your response, and I hope it's useful for others in future. – crevulus Oct 18 '21 at 13:41
0

So when you're setting up you your domain you can use a CNAME record to point to redirect to google bucket

this answers it pretty clearly - https://stackoverflow.com/a/18650641/6147146

Sam
  • 24
  • 1
  • 4