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
preguntada hace 4 años644 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
respondido hace 4 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas