public-access-proxy: prefer ip4 over ip6 for backends
ipv6 addresses change with mac addresses but our ipv4 addresses in 'serv' are static
This commit is contained in:
parent
883222a750
commit
16e19932e8
|
@ -40,10 +40,10 @@
|
|||
) (builtins.attrNames nixosConfig.services.nginx.virtualHosts)
|
||||
);
|
||||
proxyTo.host =
|
||||
if hostRegistry.hosts.${host} ? ip6
|
||||
then "[${hostRegistry.hosts.${host}.ip6}]"
|
||||
else if hostRegistry.hosts.${host} ? ip4
|
||||
if hostRegistry.hosts.${host} ? ip4
|
||||
then hostRegistry.hosts.${host}.ip4
|
||||
else if hostRegistry.hosts.${host} ? ip6
|
||||
then "[${hostRegistry.hosts.${host}.ip6}]"
|
||||
else throw "No known addresses for ${host}";
|
||||
}
|
||||
) (builtins.attrNames (
|
||||
|
|
Loading…
Reference in New Issue
Block a user