feat(nginx): enable option for vhost/location

This commit is contained in:
arcnmx 2024-03-21 11:25:31 -07:00
parent a6fced79d5
commit 8f227a1bc5
7 changed files with 116 additions and 31 deletions

View file

@ -52,17 +52,20 @@ in {
in {
plex = {
inherit name locations extraConfig kTLS;
listenPorts = {
http = { };
https.ssl = true;
external = {
enable = mkDefault (access.externalPort != null);
port = mkDefault access.externalPort;
extraParameters = [ "default_server" ];
};
};
};
plex'local = {
inherit name locations extraConfig kTLS;
local.enable = true;
};
plex-external = mkIf (access.externalPort != null) {
serverName = mkDefault "plex.${config.networking.domain}";
default = mkDefault true;
listenPorts.external.port = access.externalPort;
inherit extraConfig locations;
};
};
};
config.networking.firewall.allowedTCPPorts = mkIf (access.externalPort != null) [