keh*_*hao 6 amazon-s3 amazon-web-services amazon-cloudfront
我试图example.com使用具有两个S3起源的CloudFront 托管我的网站。S3-main网站和S3-resources资源。
所以我设置S3-main为default(*)。并S3-resources带有路径模式resources/*。
当我去https://example.com我成功加载index.html下S3-main
但当我试图让https://example.com/resorces/something.jpg我再次得到了https://example.com/index.html与像页眉下方:
http GET https://example.com/resources/something.jpg
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: keep-alive
Content-Length: 1518
Content-Type: text/html
Date: Thu, 17 Aug 2017 03:29:52 GMT
ETag: "9776b731a6c42de14c929c10b4fec28c"
Last-Modified: Thu, 17 Aug 2017 01:56:41 GMT
Server: AmazonS3
Via: 1.1 xxxxxxx.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 3OVCtUAk8mGzKt2OJD5gX9KRLHG3CBSHXf-xxxxxxxx==
X-Cache: Error from cloudfront
Run Code Online (Sandbox Code Playgroud)
为什么我得HTTP/1.1 200 OK和X-Cache: Error from cloudfront同一时间?为什么我得到的index.html不是something.jpg我预期的?
注意
我可以通过图像 S3-resources.s3.amazonaws.com
http GET https://S3-resources.s3.amazonaws.com/resources/something.jpg
Accept-Ranges: bytes
Content-Length: 176182
Content-Type: image/jpeg
Date: Thu, 17 Aug 2017 04:11:55 GMT
ETag: "xxxxxxx84b05fb6564323c"
Last-Modified: Thu, 17 Aug 2017 02:59:12 GMT
Server: AmazonS3
x-amz-id-2: xxxx/xxxl+ijjM3YTxtQ4LpdHReEOhUvAz7uPFmVwzs8Foe4WOE=
x-amz-request-id: XXXX145CA3
+--------------------+
| NOTE: binary data |
+--------------------+
Run Code Online (Sandbox Code Playgroud)
检查您的分发设置...特别是“错误页面”选项卡。
如果您配置了自定义错误响应,听起来您的配置不正确。当发生错误时,可以替换内容并重写 HTTP 状态代码,并且您报告的行为将与此类(错误)配置完全一致。
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html
| 归档时间: |
|
| 查看次数: |
7217 次 |
| 最近记录: |