nginx中文文档-ngx_http_gzip_static_module

ngx_http_gzip_static_module模块允许发送文件扩展名为“.gz”的预压缩文件。

该模块默认不会构建,需要通过–with-http_gzip_static_module参数启用。

示例配置

gzip_static  on;
gzip_proxied expired no-cache no-store private auth;

gzip_static

语法:gzip_static on | off | always
默认:gzip_static off
上下文:http, server, location

启用或禁用检查预压缩文件功能。下面的指令也会被考虑:gzip_http_version、gzip_proxied、gzip_disable以及gzip_vary。
“always”值(1.3.6+),不检查客户端是否支持,直接使用gzip文件。当在磁盘上没有未压缩的文件或使用了ngx_http_gunzip_module模块时很有效。
文件可以通过gzip命令压缩,或使用其他的命令。建议原始文件和压缩文件的修改时间保持一致。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

请开启浏览器JavaScript