Module ngx_http_gzip_static_module

ngx_http_gzip_static_module模块允许发送文件 extensions 为“ .gz”的预 zipfile,而不是常规文件。

默认情况下未构建此模块,应使用--with-http_gzip_static_module配置参数启用它。

Example Configuration

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

Directives

Syntax:gzip_static on | off | always;
Default:gzip_static off;
Context:http , server , location

启用(“ on”)或禁用(“ off”)检查预 zipfile 的存在。还考虑了以下指令:gzip_http_versiongzip_proxiedgzip_disablegzip_vary

使用“ always”值(1.3.6),在所有情况下都使用 zipfile,而无需检查客户端是否支持它。如果磁盘上没有未压缩的文件或使用了ngx_http_gunzip_module,则很有用。

可以使用gzip命令或任何其他兼容命令来 zipfile。建议原始文件和 zipfile 的修改日期和时间相同。