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 = {
|
config = {
|
||||||
services = lib.mkMerge [
|
services = lib.mkMerge [
|
||||||
{
|
(let
|
||||||
|
nginxStatusPort = 9100;
|
||||||
|
in {
|
||||||
collectd = lib.mkIf cfg.enable {
|
collectd = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@ -50,7 +52,7 @@ in
|
||||||
thermal = "";
|
thermal = "";
|
||||||
} // lib.optionalAttrs config.services.nginx.enable {
|
} // lib.optionalAttrs config.services.nginx.enable {
|
||||||
nginx = ''
|
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 {
|
nginx = lib.mkIf config.services.nginx.enable {
|
||||||
virtualHosts.localhost = {
|
virtualHosts.localhost = {
|
||||||
listen = [
|
listen = [
|
||||||
{
|
{ addr = "127.0.0.1"; port = nginxStatusPort; }
|
||||||
addr = "127.0.0.1";
|
{ addr = "[::1]"; port = nginxStatusPort; }
|
||||||
port = 9102;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 9102;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
locations."/nginx_status".extraConfig = ''
|
locations."/nginx_status".extraConfig = ''
|
||||||
stub_status;
|
stub_status;
|
||||||
|
@ -77,7 +73,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
||||||
(lib.mkIf (pkgs.system != "riscv64-linux") {
|
(lib.mkIf (pkgs.system != "riscv64-linux") {
|
||||||
nginx = {
|
nginx = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user