我试图托管我的网站example.com
使用具有两个 S3 源的 CloudFront。S3-main
对于该网站和S3-resources
为了资源。
所以我设置S3-main
as the default(*)
. And S3-resources
有路径图案resources/*
.
当我走的时候https://example.com https://example.com我成功加载了index.html
under 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
为什么我得到了HTTP/1.1 200 OK
and X-Cache: Error from cloudfront
同一时间?
为什么我得到了index.html
而不是something.jpg
正如我所料?
Note
我可以通过图像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 |
+--------------------+