From d9d6a8541ee5b0968719a4cdbe5b3506e3603dee Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 15 May 2024 22:28:35 +0200 Subject: linde: prefer zstd over gzip in caddy --- system/linde.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/system/linde.nix b/system/linde.nix index 8be5f47b..9cf9d32b 100644 --- a/system/linde.nix +++ b/system/linde.nix @@ -609,8 +609,8 @@ in "files.alanpearce.eu" = { useACMEHost = "alanpearce.eu"; extraConfig = '' + encode zstd gzip root * /srv/http/files - encode gzip zstd file_server browse ''; }; @@ -623,7 +623,7 @@ in useACMEHost = "alanpearce.eu"; extraConfig = '' root * ${pkgs.cgit-pink}/cgit/ - encode gzip zstd + encode zstd gzip handle_path /custom/* { file_server { root /srv/http/cgit/ @@ -684,6 +684,7 @@ in "ntfy.alanpearce.eu" = { useACMEHost = "alanpearce.eu"; extraConfig = '' + encode zstd gzip reverse_proxy localhost${config.services.ntfy-sh.settings.listen-http} ''; }; @@ -691,6 +692,17 @@ in useACMEHost = "alanpearce.eu"; extraConfig = '' reverse_proxy localhost:${toString config.services.searchix.settings.web.port} + encode zstd gzip { + match { + header Content-Type text/* + header Content-Type application/json* + header Content-Type application/javascript* + header Content-Type application/opensearchdescription+xml + header Content-Type application/atom+xml* + header Content-Type application/rss+xml* + header Content-Type image/svg+xml* + } + } ''; }; "legit.alanpearce.eu" = @@ -700,6 +712,7 @@ in { useACMEHost = "alanpearce.eu"; extraConfig = '' + encode zstd gzip handle_path /static/* { root * /srv/http/legit/src/static file_server @@ -709,6 +722,7 @@ in }; "papers.alanpearce.eu" = { extraConfig = '' + encode zstd gzip handle_path /static/* { root * ${config.services.paperless.package}/lib/paperless-ngx/static file_server -- cgit 1.4.1