问题: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,我在第一个和第三个url的输出上获得application / octet-stream,在第二个上获得text / html .

附加信息:

  • CORS配置:
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
  • 铲斗政策:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::amber.fidento.com/*"
        }
    ]
}
  • index.html将元数据设置为text / html