0
votes

I'm having a strange problem with making a bucket on google cloud storage open to the public (as a static website).

I created a bucket called fixparser.targetcompid.com. I followed google's procedure of adding an identifying html file to my existing host.

I am able to copy my htmls/css/js/etc. into the bucket and even view the index.html page when I provide the full url: http://commondatastorage.googleapis.com/fixparser.targetcompid.com/index.html

However, I can't get the index file if I only provide the general website address: http://commondatastorage.googleapis.com/fixparser.targetcompid.com

Following is what I see when I set MainPageSuffix and NotFoundPage:


$ ./gsutil setwebcfg -m index.html -e 404.html gs://fixparser.targetcompid.com
Setting website config on gs://fixparser.targetcompid.com/...


$ ./gsutil setwebcfg -m index.html -e 404.html gs://fixparser.targetcompidxxxx.com
Setting website config on gs://fixparser.targetcompidxxxx.com/...
GSResponseError: status=404, code=NoSuchBucket, reason=Not Found.


$ ./gsutil getwebcfg gs://fixparser.targetcompid.com
Getting website config on gs://fixparser.targetcompid.com/...

-WebsiteConfiguration>
        -MainPageSuffix>
                index.html
        -/MainPageSuffix>
        -NotFoundPage>
                404.html
        -/NotFoundPage>
-/WebsiteConfiguration>
(I don't know how else to format this xml snippet)
1

1 Answers

3
votes

The Google Cloud Storage website configuration will only affect requests directed to CNAME aliases of c.storage.googleapis.com. In this particular example, you probably want to set up a CNAME alias for fixparser.targetcompid.com to point to c.storage.googleapis.com. Once you do that, opening http://fixparser.targetcompid.com will load the index.html page you set up with the gsutil setwebcfg command.

Mike Schwartz, Google Cloud Storage Team