mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
nixos/nginx: move status page config to services.nginx
This commit is contained in:
parent
07c3d83ada
commit
d803f78e7c
|
@ -261,23 +261,6 @@ let
|
||||||
|
|
||||||
${proxyCachePathConfig}
|
${proxyCachePathConfig}
|
||||||
|
|
||||||
${optionalString cfg.statusPage ''
|
|
||||||
server {
|
|
||||||
listen ${toString cfg.defaultHTTPListenPort};
|
|
||||||
${optionalString enableIPv6 "listen [::]:${toString cfg.defaultHTTPListenPort};" }
|
|
||||||
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
location /nginx_status {
|
|
||||||
stub_status on;
|
|
||||||
access_log off;
|
|
||||||
allow 127.0.0.1;
|
|
||||||
${optionalString enableIPv6 "allow ::1;"}
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${vhosts}
|
${vhosts}
|
||||||
|
|
||||||
${cfg.appendHttpConfig}
|
${cfg.appendHttpConfig}
|
||||||
|
@ -1175,6 +1158,21 @@ in
|
||||||
services.nginx.additionalModules = optional cfg.recommendedBrotliSettings pkgs.nginxModules.brotli
|
services.nginx.additionalModules = optional cfg.recommendedBrotliSettings pkgs.nginxModules.brotli
|
||||||
++ lib.optional cfg.recommendedZstdSettings pkgs.nginxModules.zstd;
|
++ lib.optional cfg.recommendedZstdSettings pkgs.nginxModules.zstd;
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.localhost = mkIf cfg.statusPage {
|
||||||
|
listenAddresses = lib.mkDefault ([
|
||||||
|
"0.0.0.0"
|
||||||
|
] ++ lib.optional enableIPv6 "[::]");
|
||||||
|
locations."/nginx_status" = {
|
||||||
|
extraConfig = ''
|
||||||
|
stub_status on;
|
||||||
|
access_log off;
|
||||||
|
allow 127.0.0.1;
|
||||||
|
${optionalString enableIPv6 "allow ::1;"}
|
||||||
|
deny all;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.nginx = {
|
systemd.services.nginx = {
|
||||||
description = "Nginx Web Server";
|
description = "Nginx Web Server";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
Loading…
Reference in a new issue