通过CloudFront进行S3托管服务的是application / octet-stream,而不是HTML

时间:2017-04-14 11:41:08

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

问题:S3静态托管URL服务于正确的html页面,但其他URL都没有正常工作。相反,他们将我的index.html作为文件通过Web浏览器下载。会在这里请求一些帮助,因为我已经尝试过在我的研究中找到的所有解决方案。

域:http://amber.fidento.com(通过CloudFlare)

S3静态网络托管网址:http://amber.fidento.com.s3-website-us-east-1.amazonaws.com

CloudFront分配网址:d35jbnkk7p2igl.cloudfront.net

在上述每个URL上使用curl -I,我在第1和第3个URL的输出上获得application / octet-stream,在第2个上获得text / html。

其他信息:

  1. CORS配置:

    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>Authorization</AllowedHeader>
    
  2. 广告管理政策:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "PublicReadGetObject",
                "Effect": "Allow",
                "Principal": "*",
                "Action": "s3:GetObject",
                "Resource": "arn:aws:s3:::amber.fidento.com/*"
            }
        ]
    }
    
  3. index.html将元数据设置为text / html

0 个答案:

没有答案