mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
nixos/nginx: Support additional listen parameters (#56835)
This commit is contained in:
parent
6fb8b38afc
commit
3de5726e9b
@ -194,11 +194,12 @@ let
|
||||
then filter (x: x.ssl) defaultListen
|
||||
else defaultListen;
|
||||
|
||||
listenString = { addr, port, ssl, ... }:
|
||||
listenString = { addr, port, ssl, extraParameters ? [], ... }:
|
||||
"listen ${addr}:${toString port} "
|
||||
+ optionalString ssl "ssl "
|
||||
+ optionalString (ssl && vhost.http2) "http2 "
|
||||
+ optionalString vhost.default "default_server "
|
||||
+ optionalString (extraParameters != []) (concatStringsSep " " extraParameters)
|
||||
+ ";";
|
||||
|
||||
redirectListen = filter (x: !x.ssl) defaultListen;
|
||||
|
@ -31,6 +31,7 @@ with lib;
|
||||
addr = mkOption { type = str; description = "IP address."; };
|
||||
port = mkOption { type = int; description = "Port number."; default = 80; };
|
||||
ssl = mkOption { type = bool; description = "Enable SSL."; default = false; };
|
||||
extraParameters = mkOption { type = listOf str; description = "Extra parameters of this listen directive."; default = []; example = [ "reuseport" "deferred" ]; };
|
||||
}; });
|
||||
default = [];
|
||||
example = [
|
||||
|
Loading…
Reference in New Issue
Block a user