mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(nginx): proxy.ssl options
This commit is contained in:
parent
12671b3539
commit
1f9e9acde4
3 changed files with 176 additions and 135 deletions
|
|
@ -252,7 +252,7 @@ let
|
|||
|
||||
config = let
|
||||
proxyUpstream = nginx.upstreams'.${config.proxy.upstream};
|
||||
proxyScheme = if config.proxy.ssl.enabled then "https" else "http";
|
||||
proxyScheme = if config.proxy.ssl.enable then "https" else "http";
|
||||
dynamicUpstream = hasPrefix "$" config.proxy.upstream;
|
||||
hasUpstream = config.proxy.upstream != null && !dynamicUpstream;
|
||||
proxyHost =
|
||||
|
|
@ -265,7 +265,7 @@ let
|
|||
url = mkIf (config.proxy.upstream != null) (mkAlmostOptionDefault
|
||||
"${proxyScheme}://${proxyHost}"
|
||||
);
|
||||
ssl.enabled = mkAlmostOptionDefault (if hasUpstream then proxyUpstream.ssl.enable else false);
|
||||
ssl.enable = mkAlmostOptionDefault (if hasUpstream then proxyUpstream.ssl.enable else false);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue