nixpkgs/nixos/modules
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
..
config nixos: fix typos 2023-05-19 22:31:04 -04:00
hardware nixos: fix typos 2023-05-19 22:31:04 -04:00
i18n/input-method treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
installer Merge pull request #229767 from mberndt123/mberndt123/stratis-rootfs 2023-05-25 14:06:31 -04:00
misc nixos: fix typos 2023-05-19 22:31:04 -04:00
profiles nixos/installer: update getty help message 2023-04-08 20:18:28 +02:00
programs nixos: fix typos 2023-05-19 22:31:04 -04:00
security nixos/pam_mount: fix mounts without options (#234026) 2023-05-25 22:45:59 +02:00
services nixos/nginx: first-class PROXY protocol support 2023-05-26 19:48:26 +02:00
system Merge pull request #229767 from mberndt123/mberndt123/stratis-rootfs 2023-05-25 14:06:31 -04:00
tasks Merge pull request #229767 from mberndt123/mberndt123/stratis-rootfs 2023-05-25 14:06:31 -04:00
testing nixos: fix typos 2023-05-19 22:31:04 -04:00
virtualisation Merge pull request #233350 from GrahamDennis/grahamdennis/testing-networks 2023-05-26 15:57:01 +02:00
module-list.nix nixos/sftpgo: init 2023-05-25 22:46:15 +02:00
rename.nix nixos: fix typos 2023-05-19 22:31:04 -04:00