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
demandé il y a 4 ans644 vues
1 réponse
0
Réponse acceptée

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
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions