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
posta 4 anni fa644 visualizzazioni
1 Risposta
0
Risposta accettata

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
con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande