nginx module: add statusPage option
This commit is contained in:
@@ -69,7 +69,23 @@ let
|
|||||||
client_max_body_size 10m;
|
client_max_body_size 10m;
|
||||||
|
|
||||||
server_tokens ${if cfg.serverTokens then "on" else "off"};
|
server_tokens ${if cfg.serverTokens then "on" else "off"};
|
||||||
|
|
||||||
${vhosts}
|
${vhosts}
|
||||||
|
|
||||||
|
${optionalString cfg.statusPage ''
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location /nginx_status {
|
||||||
|
stub_status on;
|
||||||
|
allow 127.0.0.1;
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''}
|
||||||
}
|
}
|
||||||
|
|
||||||
${cfg.config}
|
${cfg.config}
|
||||||
@@ -163,6 +179,14 @@ in
|
|||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = mkEnableOption "Nginx Web Server";
|
enable = mkEnableOption "Nginx Web Server";
|
||||||
|
|
||||||
|
statusPage = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = "
|
||||||
|
Enable status page reachable from localhost on http://127.0.0.1/nginx_status.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
recommendedTlsSettings = mkOption {
|
recommendedTlsSettings = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
|||||||
Reference in New Issue
Block a user