refactor(nginx): Clean up nginx configuration

This commit is contained in:
Tristan Daniël Maat 2025-11-13 04:07:10 +08:00
parent d82c353329
commit 767a14ab6e
Signed by: tlater
GPG key ID: 02E935006CF2E8E7
8 changed files with 177 additions and 171 deletions

View file

@ -1,9 +1,4 @@
{
config,
pkgs,
lib,
...
}:
{ pkgs, ... }:
let
yaml = pkgs.formats.yaml { };
in
@ -68,28 +63,6 @@ in
enable = true;
listenAddress = "127.0.0.1";
};
nginxlog = {
enable = true;
listenAddress = "127.0.0.1";
group = "nginx";
settings.namespaces = lib.mapAttrsToList (name: _: {
inherit name;
metrics_override.prefix = "nginxlog";
namespace_label = "vhost";
format = lib.concatStringsSep " " [
"$remote_addr - $remote_user [$time_local]"
''"$request" $status $body_bytes_sent''
''"$http_referer" "$http_user_agent"''
''rt=$request_time uct="$upstream_connect_time"''
''uht="$upstream_header_time" urt="$upstream_response_time"''
];
source.files = [ "/var/log/nginx/${name}/access.log" ];
}) config.services.nginx.virtualHosts;
};
};
# TODO(tlater):