http_gzip_static module

http_gzip_static module#

Allows sending precompressed files with the “.gz” filename extension instead of regular files.

When building from the source code, this module isn’t built by default; it should be enabled with the ‑‑with‑http_gzip_static_module build option.

In packages and images from our repos, the module is included in the build.

Example Configuration#

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




gzip_static on | off | always;


gzip_static off;


http, server, location

Enables (on) or disables (off) checking the existence of precompressed files. The following directives are also taken into account: gzip_http_version, gzip_proxied, gzip_disable and gzip_vary.

With the always, gzipped file is used in all cases, without checking if the client supports it. It is useful if there are no uncompressed files on the disk anyway or the http_gunzip module is used.

The files can be compressed using the gzip command, or any other compatible one. It is recommended that the modification date and time of original and compressed files be the same.