【发布时间】:2020-11-12 17:46:58
【问题描述】:
我已经搜索过这个问题,但没有一个回答对我有帮助。
按照教程,我创建了一个新存储桶 (www.stepwiserefinement.co.uk),它包含一个静态站点,包括 index.html 和 error.html。
我已使用控制台将这些设置为基本 url 和未知文件的默认值。
当我访问http://www.stepwiserefinement.co.uk URL 时,我得到一个文件的 XML 列表;我应该看到 index.html。
如实报告
{"mainPageSuffix": "/index.html", "notFoundPage": "/error.html"}
但如果我访问没有路径的域,则响应是
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous caller does not have storage.objects.list access to the Google Cloud Storage bucket.
</Details>
</Error>
无需 https,无需负载均衡器。 遗漏了什么。 请提出建议。
【问题讨论】:
-
您是否在存储桶上配置了网站支持?比如你运行
gsutil web get gs://www.stepwiserefinement.co.uk这个命令会得到什么? -
这能回答你的问题吗? xml is shown instead of site
-
值已设置。 peter_dot_ward@cloudshell:~ (helpful-range-261712)$ gsutil web get gs://www.stepwiserefinement.co.uk {"mainPageSuffix": "index.html", "notFoundPage": "error.html"} 文件存在。但是当我访问没有路径的域时,我只会得到一个 XML 目录列表,或者“无法列出”,这取决于我设置的访问模式。所以这些设置没有生效。
标签: google-cloud-storage static-site