From 1267f2b4e784c44f821e053b7f921ae612826272 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Sun, 25 Aug 2024 16:34:41 +0800 Subject: [PATCH] dolomite/acme: fix port conflict with caddy --- machines/dolomite/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/machines/dolomite/default.nix b/machines/dolomite/default.nix index 22fc0e8..202edef 100644 --- a/machines/dolomite/default.nix +++ b/machines/dolomite/default.nix @@ -37,9 +37,14 @@ in acceptTerms = true; certs.${config.deployment.targetHost} = { email = "me@namely.icu"; - listenHTTP = ":80"; + # Avoid port conflict + listenHTTP = if config.services.caddy.enable then ":30310" else ":80"; }; }; + services.caddy.virtualHosts."http://${config.deployment.targetHost}:80".extraConfig = '' + reverse_proxy 127.0.0.1:30310 + ''; + networking.firewall.allowedTCPPorts = [ 80 8080 ]; networking.firewall.allowedUDPPorts = [ ] ++ (lib.range 6311 6314);