<!-- review: finished -->

<a id="http-gzip-static"></a>

# GZip Static

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

When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild),
this module isn't built by default;
it should be enabled with the
`‑‑with‑http_gzip_static_module`
[build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure).

In packages and images from [our repos](https://en.angie.software//angie/docs/installation/index.md#install-packages),
the module is included in the build.

<a id="configuration-example-21"></a>

## Configuration Example

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

<a id="directives-22"></a>

## Directives

<a id="index-0"></a>

<a id="id1"></a>

### gzip_static

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `gzip_static` `on` | `off` | `always`;   |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default                                                                                  | `gzip_static off;`                       |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | 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](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#gzip-http-version), [gzip_proxied](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#gzip-proxied), [gzip_disable](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#gzip-disable) and [gzip_vary](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#gzip-vary).

With `always`, gzipped files are used in all cases, without checking if the client supports it. This is useful if there are no uncompressed files on the disk anyway or the [GunZIP](https://en.angie.software//angie/docs/configuration/modules/http/http_gunzip.md#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.
