[英]AWS S3 static bucket hosting-Internal Server Error
我已经设置了一个AWS S3存储桶以托管具有自己URL的静态网站。 存储桶上的所有权限和其中的文件都是公共的。 我通过打开index.html页面的公共链接来确认这一点。 当我输入URL(ianpritchard.com)时,出现内部服务器错误。 我将日志记录在存储桶中,并看到我的请求拒绝了访问。 有谁知道为什么吗? 我确实在托管区域中设置了A记录。
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>xxx</RequestId>
<HostId> xxxx </HostId>
</Error>
桶策略在这里-
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::xxxx/"
}
]
}
设置问题是您的IP指向公司IP而不是AWS。
AWS提供了一个干净的设置程序来托管域,
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
分4步。
在你开始之前
Step 1: Register a Domain
Step 2: Create and Configure Buckets and Upload Data
Step 3: Add Alias Records for example.com and www.example.com
Step 4: Testing
希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.