git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #105347 from Mic92/nginx

nixos/nginx: add streamConfig option

commit8455fa3bca9eaa6cfa0dfb71a711ce2cd5827ac8 authorKevin Cox <kevincox@kevincox.ca> dateThu 7 Jan 2021, 08:46 (6 years ago) parent9ae9f926f330cc
1 file changed+21
nixos/modules/services/web-servers/nginx/default.nix+21
nixos/modules/services/web-servers/nginx/default.nix+21
@@ -206,6 +206,12 @@ let
206206 ${cfg.httpConfig}
207207 }''}
208208
209+ ${optionalString (cfg.streamConfig != "") ''
210+ stream {
211+ ${cfg.streamConfig}
212+ }
213+ ''}
214+
209215 ${cfg.appendConfig}
210216 '';
211217
@@ -483,6 +489,21 @@ in
483489 ";
484490 };
485491
492+ streamConfig = mkOption {
493+ type = types.lines;
494+ default = "";
495+ example = ''
496+ server {
497+ listen 127.0.0.1:53 udp reuseport;
498+ proxy_timeout 20s;
499+ proxy_pass 192.168.0.1:53535;
500+ }
501+ '';
502+ description = "
503+ Configuration lines to be set inside the stream block.
504+ ";
505+ };
506+
486507 eventsConfig = mkOption {
487508 type = types.lines;
488509 default = "";