Cloud Front URL重定向到S3内容

时间:2019-02-20 18:47:13

标签: amazon-web-services amazon-s3 amazon-cloudfront

当我尝试为S3静态网站创建cloudFront发行版时,cloudFront链接会将我的请求重定向到S3内容。

<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>dweep.cloud</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>

    <Contents>
    <Key>1_hRCR2q2OF7cPjIi1ZZbHPg.jpeg</Key>
    <LastModified>2019-02-20T18:19:33.000Z</LastModified>
    <ETag>"8997f1f1d53e726eeaffd024226518e7"</ETag>
    <Size>133617</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>Octopus-256.png</Key>
    <LastModified>2019-02-20T18:19:39.000Z</LastModified>
    <ETag>"2b9aca3641e9fb6c25810bc24b3413e2"</ETag>
    <Size>262913</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>error.JPG</Key>
    <LastModified>2019-02-20T18:19:34.000Z</LastModified>
    <ETag>"960fb9eb860fa594882757a3362715e5"</ETag>
    <Size>254076</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>error.html</Key>
    <LastModified>2019-02-20T18:19:33.000Z</LastModified>
    <ETag>"88913e9cb5e1502184ec5e542d0028a5"</ETag>
    <Size>465</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>header.png</Key>
    <LastModified>2019-02-20T18:19:35.000Z</LastModified>
    <ETag>"09f03a2a68d10219ff15a9a0d26ec2b0"</ETag>
    <Size>14416</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
     <Key>icon.png</Key>
     <LastModified>2019-02-20T18:19:35.000Z</LastModified>
     <ETag>"29693ac3d03498adff2f57899ac6d138"</ETag>
     <Size>262913</Size>
     <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>index.html</Key>
    <LastModified>2019-02-20T18:19:35.000Z</LastModified>
    <ETag>"a523af17ea7eb75d0c936574acb529c5"</ETag>
    <Size>17356</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key> layout.css </Key>
    <LastModified> 2019-02-20T18:19:36.000Z </LastModified>
    <ETag>"ec5b29196eb9d165236046888663fec9"</ETag>
    <Size>2383</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>logic.js</Key>
    <LastModified>2019-02-20T18:19:36.000Z</LastModified>
    <ETag>"99279646de8e9a96934b133149e0ebbc"</ETag>
    <Size>1005</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>martian.jpg</Key>
    <LastModified>2019-02-20T18:19:38.000Z</LastModified>
    <ETag>"98789e78dd86c1e10cc7f2bf8e1b087b"</ETag>
    <Size>145422</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

    <Contents>
    <Key>martian.png</Key>
    <LastModified>2019-02-20T18:19:38.000Z</LastModified>
    <ETag>"8aab4486f3d9cef246a4d22530bb55eb"</ETag>
    <Size>5866</Size>
    <StorageClass>STANDARD</StorageClass>
    </Contents>

</ListBucketResult>

我非常努力,这令人沮丧。我网站的存储桶dweep.cloud也默认为index.html和error.html。 我尝试将事物公开,并在原始路径中添加/index.html:但是输出显示访问被拒绝,因为index.html是公开的。 我也尝试过该政策:

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::dweep.cloud/*"
        }
    ]
}

0 个答案:

没有答案