From 9443a04ad6e9e16bfb996b38eac3ae1c77c5f9fa Mon Sep 17 00:00:00 2001 From: Henri Bourcereau Date: Fri, 22 May 2026 15:33:22 +0200 Subject: [PATCH] feat(system): nginx access log --- module.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/module.nix b/module.nix index 68b2833..53f77c6 100644 --- a/module.nix +++ b/module.nix @@ -123,6 +123,7 @@ in proxy_read_timeout 3600s; ''; withSSL = cfg.protocol == "https"; + listenPort = if withSSL then 443 else 80; in { "${cfg.hostname}" = { @@ -130,18 +131,19 @@ in 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; } + listen = [ + { addr = "0.0.0.0"; port = listenPort; ssl = withSSL; } + { addr = "[::]"; port = listenPort; ssl = withSSL; } ]; locations."/" = { extraConfig = proxyConfig; proxyPass = "http://trictrac-api/"; }; + + extraConfig = '' + error_log /var/log/nginx/trictrac_error.log; + access_log /var/log/nginx/trictrac_access.log; + ''; }; }; };