nixos/nginx: update recommended gzip settings

This commit is contained in:
Izorkin 2022-08-23 12:21:32 +03:00
parent 7cb23fcc1e
commit ee7e096c48
No known key found for this signature in database
GPG Key ID: 1436C1B3F3679F09
3 changed files with 42 additions and 13 deletions

View File

@ -680,6 +680,36 @@
<link xlink:href="https://github.com/google/ngx_brotli/blob/master/README.md">here</link>.
</para>
</listitem>
<listitem>
<para>
Updated recommended settings in
<literal>services.nginx.recommendedGzipSettings</literal>:
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
Enables gzip compression for only certain proxied
requests.
</para>
</listitem>
<listitem>
<para>
Allow checking and loading of precompressed files.
</para>
</listitem>
<listitem>
<para>
Updated gzip mime-types.
</para>
</listitem>
<listitem>
<para>
Increased the minimum length of a response that will be
gzipped.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<link xlink:href="https://garagehq.deuxfleurs.fr/">Garage</link>

View File

@ -172,6 +172,12 @@ In addition to numerous new and upgraded packages, this release has the followin
- A new option `recommendedBrotliSettings` has been added to `services.nginx`. Learn more about compression in Brotli format [here](https://github.com/google/ngx_brotli/blob/master/README.md).
- Updated recommended settings in `services.nginx.recommendedGzipSettings`:
- Enables gzip compression for only certain proxied requests.
- Allow checking and loading of precompressed files.
- Updated gzip mime-types.
- Increased the minimum length of a response that will be gzipped.
- [Garage](https://garagehq.deuxfleurs.fr/) version is based on [system.stateVersion](options.html#opt-system.stateVersion), existing installations will keep using version 0.7. New installations will use version 0.8. In order to upgrade a Garage cluster, please follow [upstream instructions](https://garagehq.deuxfleurs.fr/documentation/cookbook/upgrading/) and force [services.garage.package](options.html#opt-services.garage.package) or upgrade accordingly [system.stateVersion](options.html#opt-system.stateVersion).
- `hip` has been separated into `hip`, `hip-common` and `hipcc`.

View File

@ -187,22 +187,15 @@ let
brotli_buffers 32 8k;
''}
# https://docs.nginx.com/nginx/admin-guide/web-server/compression/
${optionalString cfg.recommendedGzipSettings ''
gzip on;
gzip_proxied any;
gzip_comp_level 5;
gzip_types
application/atom+xml
application/javascript
application/json
application/xml
application/xml+rss
image/svg+xml
text/css
text/javascript
text/plain
text/xml;
gzip_static on;
gzip_vary on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private auth;
gzip_types ${lib.concatStringsSep " " compressMimeTypes};
''}
${optionalString cfg.recommendedProxySettings ''