mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/nginx: Allow empty port for listen directive
When listening on unix sockets, it doesn't make sense to specify a port for nginx's listen directive. Since nginx defaults to port 80 when the port isn't specified (but the address is), we can change the default for the option to null as well without changing any behaviour.
This commit is contained in:
parent
354d127959
commit
e5c2c71280
6 changed files with 57 additions and 6 deletions
|
@ -31,12 +31,12 @@ with lib;
|
|||
options = {
|
||||
addr = mkOption {
|
||||
type = str;
|
||||
description = lib.mdDoc "IP address.";
|
||||
description = lib.mdDoc "Listen address.";
|
||||
};
|
||||
port = mkOption {
|
||||
type = port;
|
||||
type = types.nullOr port;
|
||||
description = lib.mdDoc "Port number.";
|
||||
default = 80;
|
||||
default = null;
|
||||
};
|
||||
ssl = mkOption {
|
||||
type = bool;
|
||||
|
@ -60,6 +60,7 @@ with lib;
|
|||
example = [
|
||||
{ addr = "195.154.1.1"; port = 443; ssl = true; }
|
||||
{ addr = "192.154.1.1"; port = 80; }
|
||||
{ addr = "unix:/var/run/nginx.sock"; }
|
||||
];
|
||||
description = lib.mdDoc ''
|
||||
Listen addresses and ports for this virtual host.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue