mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(nginx): upstream host option
This commit is contained in:
parent
b1676079ef
commit
c2c8cadc2e
5 changed files with 45 additions and 28 deletions
|
|
@ -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);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue