fix: fix attr check
This commit is contained in:
parent
bd8ec1736f
commit
290524071a
1 changed files with 9 additions and 9 deletions
|
|
@ -2,23 +2,23 @@
|
|||
let
|
||||
network = import ../data/network.nix;
|
||||
virtualHostFn = name: service: let
|
||||
domain = if service.domainOverride == null
|
||||
then "${name}.${network.local_domain}"
|
||||
else service.domainOverride;
|
||||
locationList = if service.reverse_proxy.endpoints == null
|
||||
then ["/"]
|
||||
else service.reverse_proxy.endpoints;
|
||||
domain = if service ? domainOverride
|
||||
then service.domainOverride
|
||||
else "${name}.${network.local_domain}";
|
||||
locationList = if service.reverse_proxy ? endpoints
|
||||
then service.reverse_proxy.endpoints
|
||||
else ["/"];
|
||||
locationsData = builtins.listToAttrs (map (endpointName: {
|
||||
name = endpointName;
|
||||
value = {
|
||||
proxyPass = "http://127.0.0.1:${builtins.toString service.reverse_proxy.port}/";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
}));
|
||||
serverAlias = lib.optionalAttrs (service.reverse_proxy.aliases != null) {
|
||||
}) locationList);
|
||||
serverAlias = lib.optionalAttrs (service.reverse_proxy ? aliases) {
|
||||
serverAliases = map (alias: "${alias}.${domain}") service.reverse_proxy.aliases;
|
||||
};
|
||||
myExtraConfig = if service.reverse_proxy.extraConfig != null
|
||||
myExtraConfig = if service.reverse_proxy ? extraConfig
|
||||
then service.reverse_proxy.extraConfig
|
||||
else {};
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue