ngx_http_gzip_static_module 模組
範例設定 指令 gzip_static |
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 off; |
Context |
http , server , location |
啟用 (“on
”) 或停用 (“off
”) 檢查預壓縮檔案是否存在。也會考慮以下指令:gzip_http_version、gzip_proxied、gzip_disable 和 gzip_vary。
使用 “always
” 值 (1.3.6),在所有情況下都會使用 gzip 壓縮檔案,而無需檢查客戶端是否支援。如果磁碟上沒有未壓縮的檔案,或者使用 ngx_http_gunzip_module 時,此功能很有用。
可以使用 gzip
命令或任何其他相容命令壓縮檔案。建議原始檔案和壓縮檔案的修改日期和時間相同。