Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/nginx: add streamConfig option #105347

Merged
merged 1 commit into from Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions nixos/modules/services/web-servers/nginx/default.nix
Expand Up @@ -179,6 +179,12 @@ let
${cfg.httpConfig}
}''}

${optionalString (cfg.streamConfig != "") ''
stream {
${cfg.streamConfig}
}
''}

${cfg.appendConfig}
'';

Expand Down Expand Up @@ -441,6 +447,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 = "";
Expand Down