refactor(nginx): upstream host option

This commit is contained in:
arcnmx 2024-04-27 11:44:58 -07:00
parent b1676079ef
commit c2c8cadc2e
5 changed files with 45 additions and 28 deletions

View file

@ -149,6 +149,10 @@ let
servers = mkOption {
type = attrsOf upstreamServer;
};
host = mkOption {
type = nullOr str;
default = null;
};
ssl = {
enable = mkEnableOption "ssl upstream";
host = mkOption {
@ -276,6 +280,7 @@ let
enable = mkAlmostOptionDefault (if hasUpstream then proxyUpstream.ssl.enable else false);
host = mkIf hasUpstream (mkAlmostOptionDefault proxyUpstream.ssl.host);
};
host = mkIf (hasUpstream && proxyUpstream.host != null) (mkAlmostOptionDefault proxyUpstream.host);
};
};
};