summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2022-08-23 12:21:32 +0300
committerIzorkin <izorkin@elven.pw>2023-01-30 23:03:01 +0300
commitee7e096c488cca19f3bceb98339ea00da7329498 (patch)
tree47364fa244a3c5c481afefd528b7059a4cd506df /nixos/modules
parent7cb23fcc1ed9e64703c0ac59c1707eaccacaecdd (diff)
downloadnixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.tar
nixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.tar.gz
nixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.tar.bz2
nixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.tar.lz
nixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.tar.xz
nixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.tar.zst
nixpkgs-ee7e096c488cca19f3bceb98339ea00da7329498.zip
nixos/nginx: update recommended gzip settings
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix19
1 files changed, 6 insertions, 13 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index c723b962c84..298c85108c3 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -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 ''