From 16e19932e8b652701026b1281fdbc525ccee08f6 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 7 Oct 2021 17:52:20 +0200 Subject: [PATCH] public-access-proxy: prefer ip4 over ip6 for backends ipv6 addresses change with mac addresses but our ipv4 addresses in 'serv' are static --- hosts/containers/public-access-proxy/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/containers/public-access-proxy/default.nix b/hosts/containers/public-access-proxy/default.nix index a1f66029..4609511a 100644 --- a/hosts/containers/public-access-proxy/default.nix +++ b/hosts/containers/public-access-proxy/default.nix @@ -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 (