S3通过CloudFront重定向
我想通过CloudFront使用S3重定向。
存储策略
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ######"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::mybucket/*"
},
S3重定向URL可以使用。但是Cloudfront域行不通。 CloudFront Origin是正确的存储桶。问题是什么?顺便说一句,水桶是空的。
<ListBucketResult>
<Name>bucket name</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
</ListBucketResult>
我还尝试了重定向规则,
[
{
"Redirect": {
"HostName": "my.app",
"HttpRedirectCode": "301",
"Protocol": "https"
}
}
]
我得到了相同的结果。
I want to use S3 redirect via CloudFront.
Bucket policy
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ######"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::mybucket/*"
},
The s3 redirect URL works. But the CloudFront domain does not work. The CloudFront origin is the correct bucket. What is the problem? By the way, the bucket is empty.
<ListBucketResult>
<Name>bucket name</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
</ListBucketResult>
I have also tried redirection rules
[
{
"Redirect": {
"HostName": "my.app",
"HttpRedirectCode": "301",
"Protocol": "https"
}
}
]
I get the same result.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案是使用S3重定向URL。
The solution is to use the s3 redirect URL.