summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorKevin Cox <kevincox@kevincox.ca>2021-01-07 08:46:29 -0500
committerGitHub <noreply@github.com>2021-01-07 08:46:29 -0500
commit8455fa3bca9eaa6cfa0dfb71a711ce2cd5827ac8 (patch)
tree24d988f89bbf78cef5c2f534782f824e38cc23ff /nixos
parent9ae9f922d5d5509115d2d0c8bfb649db7fb545ee (diff)
parent6f330ccedf5fab7c1390b3926ad9dd4e86669d60 (diff)
Merge pull request #105347 from Mic92/nginx
nixos/nginx: add streamConfig option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index 7fcd61880ea8..d6f463be9e81 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -206,6 +206,12 @@ let
${cfg.httpConfig}
}''}
+ ${optionalString (cfg.streamConfig != "") ''
+ stream {
+ ${cfg.streamConfig}
+ }
+ ''}
+
${cfg.appendConfig}
'';
@@ -483,6 +489,21 @@ in
";
};
+ streamConfig = mkOption {
+ type = types.lines;
+ default = "";
+ example = ''
+ server {
+ listen 127.0.0.1:53 udp reuseport;
+ proxy_timeout 20s;
+ proxy_pass 192.168.0.1:53535;
+ }
+ '';
+ description = "
+ Configuration lines to be set inside the stream block.
+ ";
+ };
+
eventsConfig = mkOption {
type = types.lines;
default = "";