From d1949310c5128f93a6b57b821be6a9ba4ea96c76 Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Wed, 28 Jan 2026 10:05:13 +0000 Subject: [PATCH] change(server): traefik rules --- hosts/rpi-5/nixos.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hosts/rpi-5/nixos.nix b/hosts/rpi-5/nixos.nix index 660b42f..97fd5fa 100644 --- a/hosts/rpi-5/nixos.nix +++ b/hosts/rpi-5/nixos.nix @@ -29,13 +29,27 @@ in staticConfigOptions = { entryPoints = { web = { - address = "0.0.0.0:80"; + address = ":80"; + http.redirections.entrypoint = { + to = "websecure"; + scheme = "https"; + }; asDefault = true; }; + websecure = { + address = ":443"; + asDefault = true; + http.tls.certResolver = "letsencrypt"; + }; traefik = { address = ":8081"; }; }; + certificatesResolvers.letsencrypt.acme = { + email = "doloroo@proton.me"; + storage = "${config.services.traefik.dataDir}/acme.json"; + httpChallenge.entryPoint = "web"; + }; api.dashboard = true; api.insecure = true; };