mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 16:43:58 +00:00
2e751c0772
the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like <code> and <package>, so any option using such tags will not be converted at all.
132 lines
4.6 KiB
Nix
132 lines
4.6 KiB
Nix
{ lib, ...}:
|
|
{ options = {
|
|
proto = lib.mkOption {
|
|
type = lib.types.enum [ "h2" "http/1.1" ];
|
|
default = "http/1.1";
|
|
description = lib.mdDoc ''
|
|
This option configures the protocol the backend server expects
|
|
to use.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
tls = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = lib.mdDoc ''
|
|
This option determines whether nghttpx will negotiate its
|
|
connection with a backend server using TLS or not. The burden
|
|
is on the backend server to provide the TLS certificate!
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
sni = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
description = lib.mdDoc ''
|
|
Override the TLS SNI field value. This value (in nghttpx)
|
|
defaults to the host value of the backend configuration.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
fall = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 0;
|
|
description = lib.mdDoc ''
|
|
If nghttpx cannot connect to the backend N times in a row, the
|
|
backend is assumed to be offline and is excluded from load
|
|
balancing. If N is 0 the backend is never excluded from load
|
|
balancing.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
rise = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 0;
|
|
description = lib.mdDoc ''
|
|
If the backend is excluded from load balancing, nghttpx will
|
|
periodically attempt to make a connection to the backend. If
|
|
the connection is successful N times in a row the backend is
|
|
re-included in load balancing. If N is 0 a backend is never
|
|
reconsidered for load balancing once it falls.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
affinity = lib.mkOption {
|
|
type = lib.types.enum [ "ip" "none" ];
|
|
default = "none";
|
|
description = lib.mdDoc ''
|
|
If "ip" is given, client IP based session affinity is
|
|
enabled. If "none" is given, session affinity is disabled.
|
|
|
|
Session affinity is enabled (by nghttpx) per-backend
|
|
pattern. If at least one backend has a non-"none" affinity,
|
|
then session affinity is enabled for all backend servers
|
|
sharing the same pattern.
|
|
|
|
It is advised to set affinity on all backends explicitly if
|
|
session affinity is desired. The session affinity may break if
|
|
one of the backend gets unreachable, or backend settings are
|
|
reloaded or replaced by API.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
dns = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = lib.mdDoc ''
|
|
Name resolution of a backends host name is done at start up,
|
|
or configuration reload. If "dns" is true, name resolution
|
|
takes place dynamically.
|
|
|
|
This is useful if a backends address changes frequently. If
|
|
"dns" is true, name resolution of a backend's host name at
|
|
start up, or configuration reload is skipped.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
|
|
redirect-if-not-tls = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = lib.mdDoc ''
|
|
If true, a backend match requires the frontend connection be
|
|
TLS encrypted. If it is not, nghttpx responds to the request
|
|
with a 308 status code and https URI the client should use
|
|
instead in the Location header.
|
|
|
|
The port number in the redirect URI is 443 by default and can
|
|
be changed using 'services.nghttpx.redirect-https-port'
|
|
option.
|
|
|
|
If at least one backend has "redirect-if-not-tls" set to true,
|
|
this feature is enabled for all backend servers with the same
|
|
pattern. It is advised to set "redirect-if-no-tls" parameter
|
|
to all backends explicitly if this feature is desired.
|
|
|
|
Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
|
|
for more detail.
|
|
'';
|
|
};
|
|
};
|
|
}
|