1
0
Fork 0

stats: move nginx status port to the same port as the node_exporter proxy

This commit is contained in:
Sandro - 2023-04-24 20:13:05 +02:00
parent 13e0febab4
commit ad86d6d59b
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 7 additions and 11 deletions

View File

@ -15,7 +15,9 @@ in
config = {
services = lib.mkMerge [
{
(let
nginxStatusPort = 9100;
in {
collectd = lib.mkIf cfg.enable {
enable = true;
extraConfig = ''
@ -50,7 +52,7 @@ in
thermal = "";
} // lib.optionalAttrs config.services.nginx.enable {
nginx = ''
URL "http://localhost/nginx_status"
URL "http://localhost:${toString nginxStatusPort}/nginx_status"
'';
};
};
@ -58,14 +60,8 @@ in
nginx = lib.mkIf config.services.nginx.enable {
virtualHosts.localhost = {
listen = [
{
addr = "127.0.0.1";
port = 9102;
}
{
addr = "[::1]";
port = 9102;
}
{ addr = "127.0.0.1"; port = nginxStatusPort; }
{ addr = "[::1]"; port = nginxStatusPort; }
];
locations."/nginx_status".extraConfig = ''
stub_status;
@ -77,7 +73,7 @@ in
'';
};
};
}
})
(lib.mkIf (pkgs.system != "riscv64-linux") {
nginx = {