gpt4 book ai didi

amazon-web-services - CloudFront 获得 X-Cache : Error from cloudfront with Status Code 200

转载 作者:行者123 更新时间:2023-12-04 12:51:42 25 4
gpt4 key购买 nike

我试图托管我的网站 example.com使用带有两个 S3 源的 CloudFront。 S3-main用于网站和 S3-resources对于资源。

所以我设置了S3-maindefault(*) .和 S3-resources带路径模式 resources/* .

当我去https://example.com我成功加载 index.htmlS3-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 OKX-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 |
+--------------------+

最佳答案

检查您的分发设置...特别是错误页面选项卡。

如果您配置了自定义错误响应,那么听起来您的配置不正确。发生错误时可以替换内容并重写 HTTP 状态代码,并且您报告的行为将与此类(错误)配置完全一致。

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html

关于amazon-web-services - CloudFront 获得 X-Cache : Error from cloudfront with Status Code 200,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45726506/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com