0

Googleクラウドストレージのバケットを(静的Webサイトとして)公開する際に奇妙な問題が発生しています。

fixparser.targetcompid.com というバケットを作成しました。識別用の html ファイルを既存のホストに追加する Google の手順に従いました。

htmls/css/js/etc をコピーできます。バケットに入れ、完全な URL を提供すると index.html ページを表示することさえできます: http://commondatastorage.googleapis.com/fixparser.targetcompid.com/index.html

ただし、一般的な Web サイトのアドレス ( http://commondatastorage.googleapis.com/fixparser.targetcompid.com ) のみを提供すると、インデックス ファイルを取得できません。

MainPageSuffix と 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)
4

1 に答える 1

3

Google Cloud Storage ウェブサイトの構成は、c.storage.googleapis.com の CNAME エイリアスに向けられたリクエストのみに影響します。この特定の例では、c.storage.googleapis.com を指すように fixparser.targetcompid.com の CNAME エイリアスをセットアップする必要があります。これを行ったら、http: //fixparser.targetcompid.com を開くと、gsutil setwebcfg コマンドで設定した index.html ページが読み込まれます。

Mike Schwartz、Google Cloud Storage チーム

于 2013-02-10T22:10:17.833 に答える