refactor(nginx): ssl preread

This commit is contained in:
arcnmx 2024-04-23 13:18:47 -07:00
parent 418caefe64
commit b0a3da835c
7 changed files with 162 additions and 74 deletions

View file

@ -1,13 +1,16 @@
{
config,
lib,
pkgs,
...
}:
with lib; {
networking.firewall.interfaces.local.allowedTCPPorts = [
443
80
}: let
inherit (lib.modules) mkIf mkDefault;
cfg = config.services.nginx;
in {
networking.firewall.interfaces.local.allowedTCPPorts = let
inherit (cfg.ssl) preread;
in mkIf cfg.enable [
(if preread.enable then preread.serverPort else cfg.defaultSSLListenPort)
cfg.defaultHTTPListenPort
];
services.nginx = {