fix(nix): nginx vhost explicit listen

This commit is contained in:
Henri Bourcereau 2026-05-09 18:06:31 +02:00
parent 9dc803e078
commit cb65f94dde

View file

@ -123,6 +123,15 @@ in
"${cfg.hostname}" = { "${cfg.hostname}" = {
enableACME = withSSL; enableACME = withSSL;
forceSSL = withSSL; forceSSL = withSSL;
# Explicit listen so this vhost isn't shadowed by a default_server
# created by other virtual hosts with forceSSL = true.
listen = if withSSL then [
{ addr = "0.0.0.0"; port = 443; ssl = true; }
{ addr = "[::]"; port = 443; ssl = true; }
] else [
{ addr = "0.0.0.0"; port = 80; ssl = false; }
{ addr = "[::]"; port = 80; ssl = false; }
];
locations."/" = { locations."/" = {
extraConfig = proxyConfig; extraConfig = proxyConfig;
proxyPass = "http://trictrac-api/"; proxyPass = "http://trictrac-api/";