压缩无法在Cloudfront中正常工作

时间:2018-10-25 09:53:36

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

enter image description here Cloudfront遇到了一个大问题,因为它无法即时压缩我的文件。我的起源是S3 Bucket。 样本比冗长而乏味的谈话更容易理解:

有关S3来源的示例文件: [https://fidzup-vendorlist.s3.amazonaws.com/vendorlist.json] Cloudfront上的相同文件: [https://vendorlist.fidzup.mgr.consensu.org/vendorlist.json] 或使用HTTP上的原始名称(不是):[http://d31444f3ddxyqh.cloudfront.net/vendorlist.json]

我验证的内容: Content-Length 由S3正确设置(并确保添加了CORS配置) 文件长度(72483)在1000到10000000之间 Content-Type (application / json)在接受的列表([https://docs.aws.amazon.com/en_us/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types])中 我的行为策略将自动对象压缩设置为“是”(请参见所附图片,对不起,法语)。

我确定S3不会发送任何 Content-Encoding 标头... 我多次使缓存无效。 我尊重在[https://docs.aws.amazon.com/en_us/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html]

上发现的所有细节

从S3拨打电话:         笔记本电脑:〜用户$ curl -0 -v -I https://fidzup-         vendorlist.s3.amazonaws.com/vendorlist.json         *尝试52.95.154.15 ...         * TCP_NODELAY设置         *连接到fidzup-vendorlist.s3.amazonaws.com(52.95.154.15)         端口443(#0)         * ALPN,提供http / 1.1         *密码选择:         全部:!导出:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH         *成功设置证书验证位置:         * CAfile:/etc/ssl/cert.pem         CApath:无         * TLSv1.2(OUT),TLS握手,客户端问候(1):         * TLSv1.2(IN),TLS握手,服务器问候(2):         * TLSv1.2(IN),TLS握手,证书(11):         * TLSv1.2(IN),TLS握手,服务器密钥交换(12):         * TLSv1.2(IN),TLS握手,服务器完成(14):         * TLSv1.2(OUT),TLS握手,客户端密钥交换(16):         * TLSv1.2(OUT),TLS更改密码,客户端问候(1):         * TLSv1.2(OUT),TLS握手,已完成(20):         * TLSv1.2(IN),TLS更改密码,客户端问候(1):         * TLSv1.2(IN),TLS握手,完成(20):         *使用TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256的SSL连接         * ALPN,服务器不同意协议         *服务器证书:         *主题:C = US; ST =华盛顿; L =西雅图; O = Amazon.com Inc .;         CN = *。s3.amazonaws.com         *开始日期:2017年9月22日00:00:00 GMT         *到期日期:2019年1月3日12:00:00 GMT         * subjectAltName:托管“ fidzup-vendorlist.s3.amazonaws.com”         匹配证书的“ * .s3.amazonaws.com”         *发行者:C = US; O = DigiCert Inc; OU = www.digicert.com; CN = DigiCert         巴尔的摩CA-2 G2         * SSL证书验证成功。

  

HEAD /vendorlist.json HTTP / 1.0   主持人:fidzup-vendorlist.s3.amazonaws.com   用户代理:curl / 7.54.0   接受: /

    < HTTP/1.1 200 OK
    HTTP/1.1 200 OK
        < x-amz-id-2: 
 tE5hoCkP/dfvS2ZHmiNAz+j5cEuUj0ClO9r1/DOWc6DyW2KEBi4FYuuysdDT9uFOLPO344cT3h4=
x-amz-id-2: tE5hoCkP/dfvS2ZHmiNAz+j5cEuUj0ClO9r1/DOWc6DyW2KEBi4FYuuysdDT9uFOLPO344cT3h4=
      < x-amz-request-id: 851237D5F7CCD542
x-amz-request-id: 851237D5F7CCD542
< Date: Thu, 25 Oct 2018 09:08:29 GMT
Date: Thu, 25 Oct 2018 09:08:29 GMT
< Last-Modified: Wed, 24 Oct 2018 16:00:16 GMT
Last-Modified: Wed, 24 Oct 2018 16:00:16 GMT
< ETag: "70733eeb2021b0846796130668214816"
ETag: "70733eeb2021b0846796130668214816"
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
< Content-Length: 72483
Content-Length: 72483
< Server: AmazonS3
Server: AmazonS3
< Connection: close
Connection: close
< 
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
*Call from CloudFront:*

Laptop:~ user$ curl -0 -v -I -H 'Accept-Encoding: gzip'  https://vendorlist.fidzup.mgr.consensu.org/vendorlist.json
*   Trying 143.204.229.68...
* TCP_NODELAY set
* Connected to vendorlist.fidzup.mgr.consensu.org (143.204.229.68) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=vendorlist.fidzup.mgr.consensu.org
*  start date: Sep  7 00:00:00 2018 GMT
*  expire date: Oct  7 12:00:00 2019 GMT
*  subjectAltName: host "vendorlist.fidzup.mgr.consensu.org" matched cert's "vendorlist.fidzup.mgr.consensu.org"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
> HEAD /vendorlist.json HTTP/1.0
> Host: vendorlist.fidzup.mgr.consensu.org
> User-Agent: curl/7.54.0
> Accept: */*
> Accept-Encoding: gzip
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
< Content-Length: 72483
Content-Length: 72483
< Connection: close
Connection: close
< Date: Thu, 25 Oct 2018 08:45:07 GMT
Date: Thu, 25 Oct 2018 08:45:07 GMT
< Last-Modified: Wed, 24 Oct 2018 16:00:16 GMT
Last-Modified: Wed, 24 Oct 2018 16:00:16 GMT
< ETag: "70733eeb2021b0846796130668214816"
ETag: "70733eeb2021b0846796130668214816"
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Server: AmazonS3
Server: AmazonS3
< Vary: Accept-Encoding
Vary: Accept-Encoding
< Age: 895
Age: 895
< X-Cache: Hit from cloudfront
X-Cache: Hit from cloudfront
< Via: 1.1 9d2c93ece5a5ccb2b5952a40f7502a04.cloudfront.net (CloudFront)
  Via: 1.1 9d2c93ece5a5ccb2b5952a40f7502a04.cloudfront.net (CloudFront)
  < X-Amz-Cf-Id: dkUuGREZ1NFrlzdGv5Hy4oySj1YmjjAPnErAcBauoMIntKOWyO78Hw==
  X-Amz-Cf-Id: dkUuGREZ1NFrlzdGv5Hy4oySj1YmjjAPnErAcBauoMIntKOWyO78Hw==

 < 
  * Closing connection 0
  * TLSv1.2 (OUT), TLS alert, Client hello (1):

我没主意了……有人知道我需要在哪里寻找解决方案吗?

提前谢谢。

0 个答案:

没有答案