tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/nginx: move status page config to `services.nginx`
h7x4
2 years ago
d803f78e
07c3d83a
+15
-17
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
web-servers
nginx
default.nix
+15
-17
nixos/modules/services/web-servers/nginx/default.nix
···
261
261
262
262
${proxyCachePathConfig}
263
263
264
264
-
${optionalString cfg.statusPage ''
265
265
-
server {
266
266
-
listen ${toString cfg.defaultHTTPListenPort};
267
267
-
${optionalString enableIPv6 "listen [::]:${toString cfg.defaultHTTPListenPort};" }
268
268
-
269
269
-
server_name localhost;
270
270
-
271
271
-
location /nginx_status {
272
272
-
stub_status on;
273
273
-
access_log off;
274
274
-
allow 127.0.0.1;
275
275
-
${optionalString enableIPv6 "allow ::1;"}
276
276
-
deny all;
277
277
-
}
278
278
-
}
279
279
-
''}
280
280
-
281
264
${vhosts}
282
265
283
266
${cfg.appendHttpConfig}
···
1174
1157
1175
1158
services.nginx.additionalModules = optional cfg.recommendedBrotliSettings pkgs.nginxModules.brotli
1176
1159
++ lib.optional cfg.recommendedZstdSettings pkgs.nginxModules.zstd;
1160
1160
+
1161
1161
+
services.nginx.virtualHosts.localhost = mkIf cfg.statusPage {
1162
1162
+
listenAddresses = lib.mkDefault ([
1163
1163
+
"0.0.0.0"
1164
1164
+
] ++ lib.optional enableIPv6 "[::]");
1165
1165
+
locations."/nginx_status" = {
1166
1166
+
extraConfig = ''
1167
1167
+
stub_status on;
1168
1168
+
access_log off;
1169
1169
+
allow 127.0.0.1;
1170
1170
+
${optionalString enableIPv6 "allow ::1;"}
1171
1171
+
deny all;
1172
1172
+
'';
1173
1173
+
};
1174
1174
+
};
1177
1175
1178
1176
systemd.services.nginx = {
1179
1177
description = "Nginx Web Server";