From c2a543f83b96e29d3e873b88854cb1ee67a35736 Mon Sep 17 00:00:00 2001 From: blake Date: Sun, 12 Oct 2025 11:46:50 -0500 Subject: [PATCH] 346 current 2025-10-12 11:43:32 25.05.20251006.20c4598 6.12.50 * --- flake.nix | 2 +- modules/homelab/services/caddy/default.nix | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 906311f..4f16beb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ # flake for blakes nixos config # define new devices in outputs -# generation: 345 current 2025-10-12 11:39:59 25.05.20251006.20c4598 6.12.50 * +# generation: 346 current 2025-10-12 11:43:32 25.05.20251006.20c4598 6.12.50 * { description = "blakes nix config"; inputs = { diff --git a/modules/homelab/services/caddy/default.nix b/modules/homelab/services/caddy/default.nix index 5f16064..2ee7fb4 100644 --- a/modules/homelab/services/caddy/default.nix +++ b/modules/homelab/services/caddy/default.nix @@ -47,15 +47,13 @@ in email = "me@blakedheld.xyz"; globalConfig = '' auto_https ignore_loaded_certs + handle_errors { + @notFound { + expression {http.error.status_code} == 404 + } + redir @notFound https://www.youtube.com/watch?v=dQw4w9WgXcQ 302 + } ''; - virtualHosts = { - # catch all redirect - "catchall" = { - extraConfig = '' - @catchall not host * - redir @catchall https://www.youtube.com/watch?v=dQw4w9WgXcQ 302 - ''; - }; }; };