问题描述
我已经在Amazon S3上建立了一个示例静态网站,并向其中添加了一个自定义文件夹,其内部文件为:custom-folder/index.html
,但是尝试访问URL /custom-folder
时出现Access Denied
错误.
I've set up an example static website on Amazon S3 and I added a custom folder to it with file inside: custom-folder/index.html
, butI'm getting Access Denied
error when trying to access url /custom-folder
.
索引文档被配置为index.html
,因此当我访问/custom-folder
url时,S3应该服务于index.html
,但它不起作用.
The index document is configured to be index.html
, so S3 should serve index.html
when I'm accessing /custom-folder
url, but it doesn't work.
我该如何解决?
推荐答案
似乎您使用了错误的URL来访问存储桶.例如,当您在S3(在本例中为us-west-2)中启用静态网站托管功能时,系统会为您提供以下格式的URL:
It seems you are using the wrong URL to access the bucket.For example, when you enable to static website hosting feature in S3 (us-west-2 in this example), you are given a URL with the following format:
端点: http://bucket-name.s3-website- us-west-2.amazonaws.com
您可以通过转到S3>单击存储桶>存储桶属性>静态网站托管>查看端点,以显示您的端点.
You can see your endpoint by going to S3 > Click on your bucket > Bucket Properties > Static website hosting > should reveal your endpoint.
这篇关于拒绝访问index.html Amazon S3静态网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!