nixpkgs/nixos/modules/services/web-servers
Raito Bezarius 69bb0f94de nixos/nginx: first-class PROXY protocol support
PROXY protocol is a convenient way to carry information about the
originating address/port of a TCP connection across multiple layers of
proxies/NAT, etc.

Currently, it is possible to make use of it in NGINX's NixOS module, but
is painful when we want to enable it "globally".
Technically, this is achieved by reworking the defaultListen options and
the objective is to have a coherent way to specify default listeners in
the current API design.
See `mkDefaultListenVhost` and `defaultListen` for the details.

It adds a safeguard against running a NGINX with no HTTP listeners (e.g.
only PROXY listeners) while asking for ACME certificates over HTTP-01.

An interesting usecase of PROXY protocol is to enable seamless IPv4 to
IPv6 proxy with origin IPv4 address for IPv6-only NGINX servers, it is
demonstrated how to achieve this in the tests, using sniproxy.

Finally, the tests covers:

- NGINX `defaultListen` mechanisms are not broken by these changes;
- NGINX PROXY protocol listeners are working in a final usecase
  (sniproxy);
- uses snakeoil TLS certs from ACME setup with wildcard certificates;

In the future, it is desirable to spoof-attack NGINX in this scenario to
ascertain that `set_real_ip_from` and all the layers are working as
intended and preventing any user from setting their origin IP address to
any arbitrary, opening up the NixOS module to bad™ vulnerabilities.

For now, it is quite hard to achieve while being minimalistic about the
tests dependencies.
2023-05-26 19:48:26 +02:00
..
apache-httpd nixos: fix typos 2022-12-17 19:31:14 -05:00
caddy nixos/caddy: fix caddy fmt for caddy v2.6.3 2023-02-09 03:36:10 +01:00
hitch nixos/*: convert straggler options to MD 2022-08-31 17:27:38 +02:00
jboss treewide: source .attrs in builders 2022-12-08 21:09:02 +02:00
keter nixos: fix typos 2022-12-17 19:31:14 -05:00
lighttpd treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
nginx nixos/nginx: first-class PROXY protocol support 2023-05-26 19:48:26 +02:00
phpfpm nixos/*: convert options with admonitions to MD 2022-08-31 16:36:16 +02:00
trafficserver nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
unit unit: 1.29.1 -> 1.30.0 2023-05-13 16:55:47 +03:00
varnish nixos: Use checks instead of extraDependencies 2023-05-11 21:18:38 +02:00
agate.nix nixos: fix typos 2022-12-17 19:31:14 -05:00
darkhttpd.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
fcgiwrap.nix treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
garage.md nixos: fix typos 2023-05-19 22:31:04 -04:00
garage.nix nixos/garage: fix links to config reference 2023-04-06 13:40:38 +04:00
hydron.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
merecat.nix nixos/merecat: init 2022-10-31 09:24:28 +01:00
mighttpd2.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
minio.nix fixup! nixos/minio: activate/restart service on credentials path changes 2023-03-16 09:45:09 -07:00
molly-brown.nix nixos/*: convert options with listings 2022-08-31 17:27:36 +02:00
pomerium.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
stargazer.nix nixos: fix typos 2023-05-19 22:31:04 -04:00
tomcat.nix treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
traefik.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
ttyd.nix nixos: fix typos 2022-12-17 19:31:14 -05:00
uwsgi.nix nixos/*: convert options with admonitions to MD 2022-08-31 16:36:16 +02:00
zope2.nix nixos: fix typos 2022-12-17 19:31:14 -05:00