forked from c3d2/nix-config
stats: move nginx status port to the same port as the node_exporter proxy
This commit is contained in:
parent
13e0febab4
commit
ad86d6d59b
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue