dolomite/acme: fix port conflict with caddy

This commit is contained in:
xinyangli 2024-08-25 16:34:41 +08:00
parent 30689a18b5
commit 1267f2b4e7
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk

View file

@ -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);