How to host an entire site on Google Cloud Storage

2019-02-02 04:47发布

Is there any way to host an entire site on Google Cloud Storage? That is, map a bucket directly to a top level domain.

E.g. create a bucket called mysite.com, then when the user visits mysite.com serve the content directly from cloud storage?

I see how to CNAME a subdomain, e.g. static.mysite.com, but can't figure out how to map the top-level domain to a bucket.

Any solution?

7条回答
冷血范
2楼-- · 2019-02-02 05:25

This is an old question, but in case anyone comes across this post- I encountered the same issue today.

Google Domains is my domain registrar. Assuming this is also the case for you, here's how you would set it up:

Under "Custom resource records"...

Create a CNAME record for "www" that points to "c.storage.googleapis.com".

Under "Synthetic records"...

Choose "Subdomain forward". Enter "mydomain.com" in the left-most (subdomain) input and "www.mydomain.com" in the right-most (destination URL) input.

查看更多
登录 后发表回答