feat(system): nginx access log

This commit is contained in:
Henri Bourcereau 2026-05-22 15:33:22 +02:00
parent c7bb3a3291
commit 9443a04ad6

View file

@ -123,6 +123,7 @@ in
proxy_read_timeout 3600s; proxy_read_timeout 3600s;
''; '';
withSSL = cfg.protocol == "https"; withSSL = cfg.protocol == "https";
listenPort = if withSSL then 443 else 80;
in in
{ {
"${cfg.hostname}" = { "${cfg.hostname}" = {
@ -130,18 +131,19 @@ in
forceSSL = withSSL; forceSSL = withSSL;
# Explicit listen so this vhost isn't shadowed by a default_server # Explicit listen so this vhost isn't shadowed by a default_server
# created by other virtual hosts with forceSSL = true. # created by other virtual hosts with forceSSL = true.
listen = listen = [
if withSSL then [ { addr = "0.0.0.0"; port = listenPort; ssl = withSSL; }
{ addr = "0.0.0.0"; port = 443; ssl = true; } { addr = "[::]"; port = listenPort; ssl = withSSL; }
{ 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/";
}; };
extraConfig = ''
error_log /var/log/nginx/trictrac_error.log;
access_log /var/log/nginx/trictrac_access.log;
'';
}; };
}; };
}; };