mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 21:25:30 +03:00
nginx: add listenAddresses
This allows the user to manually specify the addresses nginx shoud listen on, while still having the convinience to use the *SSL options and have the ports automatically applied
This commit is contained in:
parent
707f6106fe
commit
a4ca45acd7
2 changed files with 24 additions and 7 deletions
|
@ -230,13 +230,13 @@ let
|
|||
|
||||
defaultListen =
|
||||
if vhost.listen != [] then vhost.listen
|
||||
else optionals (hasSSL || vhost.rejectSSL) (
|
||||
singleton { addr = "0.0.0.0"; port = 443; ssl = true; }
|
||||
++ optional enableIPv6 { addr = "[::]"; port = 443; ssl = true; }
|
||||
) ++ optionals (!onlySSL) (
|
||||
singleton { addr = "0.0.0.0"; port = 80; ssl = false; }
|
||||
++ optional enableIPv6 { addr = "[::]"; port = 80; ssl = false; }
|
||||
);
|
||||
else
|
||||
let addrs = if vhost.listenAddresses != [] then vhost.listenAddreses else (
|
||||
[ "0.0.0.0" ] ++ optional enableIPv6 "[::0]"
|
||||
);
|
||||
in
|
||||
optionals (hasSSL || vhost.rejectSSL) (map (addr: { inherit addr; port = 443; ssl = true; }) addrs)
|
||||
++ optionals (!onlySSL) (map (addr: { inherit addr; port = 80; ssl = false; }) addrs);
|
||||
|
||||
hostListen =
|
||||
if vhost.forceSSL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue