nixos/nginx: add streamConfig option
commit6f330ccedf5fab7c1390b3926ad9dd4e86669d60
authorJörg Thalheim <joerg@thalheim.io>
dateSun 25 Oct 2020, 07:21 (6 years ago)
parent82cf3b9
nixos/modules/services/web-servers/nginx/default.nix+21
@@ -179,6 +179,12 @@ let
179179 ${cfg.httpConfig}
180180 }''}
181181
182+ ${optionalString (cfg.streamConfig != "") ''
183+ stream {
184+ ${cfg.streamConfig}
185+ }
186+ ''}
187+
182188 ${cfg.appendConfig}
183189 '';
184190
@@ -441,6 +447,21 @@ in
441447 ";
442448 };
443449
450+ streamConfig = mkOption {
451+ type = types.lines;
452+ default = "";
453+ example = ''
454+ server {
455+ listen 127.0.0.1:53 udp reuseport;
456+ proxy_timeout 20s;
457+ proxy_pass 192.168.0.1:53535;
458+ }
459+ '';
460+ description = "
461+ Configuration lines to be set inside the stream block.
462+ ";
463+ };
464+
444465 eventsConfig = mkOption {
445466 type = types.lines;
446467 default = "";