How to host an entire site on Google Cloud Storage?

后端 未结 8 1126

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 <

相关标签:
8条回答
  • 2020-12-14 02:13

    Yes, this is possible and is documented here: https://developers.google.com/storage/docs/website-configuration

    Basically, you need to set up a CNAME redirect to c.storage.googleapis.com

    0 讨论(0)
  • 2020-12-14 02:15

    It's been a few years, but to anyone facing the same issue (mapping a "naked domain" to a GCS bucket), I see a couple of ways of achieving this.

    One is to use any DNS provider that supports "CNAME flattening" (aka ALIAS, or ANAME records). Examples are: DNSimple, NS1, Dyn, DNS Made Easy, and Cloudflare.

    Cloudflare is also one of the recommended ways of serving your bucket through HTTPS, and might also save you some money on your egress bill.

    Another option, is to use this project to serve your files through App Engine. You get SSL for free, can use it on your "naked domain", and it allows you to configure redirects, rewrites, and custom headers.

    0 讨论(0)
提交回复
热议问题