summary refs log tree commit diff
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-09-26 13:41:54 +0100
committerGitHub <noreply@github.com>2016-09-26 13:41:54 +0100
commitff980cc5533238ca42b5d8897ffae869e325ee0e (patch)
tree1390fdc7078217981cf14ad523f6bafb71ac4702
parent9c5610d75900b494094ac81455d3f3fa6f8ae75a (diff)
parent54c5154b90aa0712699569c5f443d7a8f7102e9d (diff)
downloadnixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.tar
nixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.tar.gz
nixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.tar.bz2
nixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.tar.lz
nixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.tar.xz
nixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.tar.zst
nixpkgs-ff980cc5533238ca42b5d8897ffae869e325ee0e.zip
Merge pull request #18961 from wlhlm/nginx-events
Allow configuration of events{} block in nginx module
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix19
1 files changed, 15 insertions, 4 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index 94c442e165b..443bd8c1000 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -18,9 +18,13 @@ let
 
     ${cfg.config}
 
-    ${optionalString (cfg.httpConfig == "" && cfg.config == "") ''
-    events {}
+    ${optionalString (cfg.eventsConfig != "" || cfg.config == "") ''
+    events {
+      ${cfg.eventsConfig}
+    }
+    ''}
 
+    ${optionalString (cfg.httpConfig == "" && cfg.config == "") ''
     http {
       include ${cfg.package}/conf/mime.types;
       include ${cfg.package}/conf/fastcgi.conf;
@@ -98,7 +102,6 @@ let
     }''}
 
     ${optionalString (cfg.httpConfig != "") ''
-    events {}
     http {
       include ${cfg.package}/conf/mime.types;
       include ${cfg.package}/conf/fastcgi.conf;
@@ -272,12 +275,20 @@ in
         ";
       };
 
+      eventsConfig = mkOption {
+        type = types.lines;
+        default = "";
+        description = ''
+          Configuration lines to be set inside the events block.
+        '';
+      };
+
       appendHttpConfig = mkOption {
         type = types.lines;
         default = "";
         description = "
           Configuration lines to be appended to the generated http block.
-          This is mutually exclusive with using config and httpConfig for 
+          This is mutually exclusive with using config and httpConfig for
           specifying the whole http block verbatim.
         ";
       };