From 2e2e532ea8c7a4e157d877978134cfd7409b6744 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sat, 2 Sep 2023 22:18:04 +1000 Subject: [PATCH] Add some more debug logging to register-servers, found the issue --- src/lua/scripts/register-servers.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lua/scripts/register-servers.lua b/src/lua/scripts/register-servers.lua index defb6c6..95d1161 100644 --- a/src/lua/scripts/register-servers.lua +++ b/src/lua/scripts/register-servers.lua @@ -24,14 +24,17 @@ function setup_servers() tcp:connect("127.0.0.1", 2000); --TODO: configurable port while line do local domain, backend_host = line:match("([^%s]+)%s+([^%s]+)") + print("reading line hosts.map: domain="..domain..",backend_host="..backend_host) local new_map_value = server_prefix..counter local existing_map_value = backends_map:lookup(domain) if existing_map_value ~= nil then + print("existing_map_value: "..existing_map_value) current_backends = utils.split(existing_map_value, ",") if not utils.contains(current_backends, new_map_value) then new_map_value = new_map_value .. "," .. existing_map_value end end + print("setting entry hosts.map: domain="..domain..",new_map_value="..new_map_value) core.set_map("/etc/haproxy/map/backends.map", domain, new_map_value) local server_name = "servers/websrv"..counter --NOTE: if you have a proper CA setup,