Amazon CloudFront serving compressed files with Origin server running NGINX

0

A customer is serving compressed via Amazon CloudFront by zipping the content on the origin server using NGINX module. They have not enabled the option on the CloudFront distribution to compress objects automatically. Would this option needed to be enabled?

AWS
질문됨 4년 전644회 조회
1개 답변
0
수락된 답변

They don't need to enable compression on CloudFront if the origin already compresses files, "if your origin returns a compressed file to CloudFront, CloudFront detects that the file is compressed based on the value of the Content-Encoding header and doesn't compress the file again." - https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html

Note that there is a configuration for NGINX origins:

When CloudFront forwards a request to the origin server, it includes a Via header. This causes NGINX to interpret the request as proxied and, by default, NGINX disables compression for proxied requests. If your version of NGINX includes the gzip_proxied setting, change the value to any so that NGINX will return compressed content to CloudFront. For more information, see the NGINX documentation for the module ngx_http_gzip_module.

AWS
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠