compression-vary: Enhanced Vary header handling for compression
Debian/Ubuntu installation
These docs apply to the APT package nginx-module-compression-vary provided by the GetPageSpeed Extras repository.
- Configure the APT repository as described in APT repository setup.
- Install the module:
sudo apt-get update
sudo apt-get install nginx-module-compression-vary
Show suites and architectures
| Distro | Suite | Component | Architectures |
|----------|-------------------|-------------|-----------------|
| debian | bookworm | main | amd64, arm64 |
| debian | bookworm-mainline | main | amd64, arm64 |
| debian | trixie | main | amd64, arm64 |
| debian | trixie-mainline | main | amd64, arm64 |
| ubuntu | focal | main | amd64, arm64 |
| ubuntu | focal-mainline | main | amd64, arm64 |
| ubuntu | jammy | main | amd64, arm64 |
| ubuntu | jammy-mainline | main | amd64, arm64 |
| ubuntu | noble | main | amd64, arm64 |
| ubuntu | noble-mainline | main | amd64, arm64 |
Name
ngx_http_compression_vary_filter_module is a header filter module used instead of the 'gzip_vary' directive.
Table of Content
- ngx_http_compression_vary_filter_module
- Name
- Table of Content
- Status
- Synopsis
- Installation
- Directives
- compression_vary
- Author
- License
Status
This Nginx module is currently considered experimental. Issues and PRs are welcome if you encounter any problems.
Synopsis
server {
listen 127.0.0.1:8080;
server_name localhost;
location / {
gzip on;
compression_vary on;
proxy_pass http://foo.com;
}
}
Directives
compression_vary
Syntax: compression_vary on | off;
Default: compression_vary off;
Context: http, server, location
Enables or disables inserting the Vary: Accept-Encoding response header field if the directives gzip, gzip_static, or gunzip are active.
Unlike gzip_vary, if a Vary header exists for the original response, it will append the Accept-Encoding to the original Vary header. In addition, multiple Vary headers will be merged into one and separated by commas. Duplicate header values in Vary will be removed.
This module is also effective when the directives from third-party compression modules such as brotli, brotli_static, unbrotli, zstd, zstd_static, and unzstd are activated.