模块 ngx_http_gzip_static_module


示例Directives
gzip_static

ngx_http_gzip_static_modulemodule 允许 发送带有 ”.gz” 文件扩展名而不是常规文件。

这个模块不是默认构建的,它应该使用--with-http_gzip_static_moduleconfiguration 参数。

示例配置

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

Directives

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

启用 (”on“) 或禁用 (”off”) 检查是否存在预压缩文件。 此外,还会考虑以下Directives:gzip_http_versiongzip_proxiedgzip_disable、 和 gzip_vary

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

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