From 98228abe7407539459816082f783b80e8f224fce Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sat, 15 May 2021 21:10:38 +0200 Subject: [PATCH] Allow Consul api to set default config for addr As can be seen in https://github.com/hashicorp/consul/blob/91ee7990ccf27ab7fccff746f8df0df65c3c583d/api/api.go#L390 the API also defaults to localhost:8500, however it can also use the environment variable CONSUL_HTTP_ADDR which is useful when fabio is run with nomad. This change makes sure that the existing default stays working, but it now works better by default in more situations --- config/default.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.go b/config/default.go index 2e60e708b..638b1dafa 100644 --- a/config/default.go +++ b/config/default.go @@ -56,8 +56,8 @@ var defaultConfig = &Config{ Registry: Registry{ Backend: "consul", Consul: Consul{ - Addr: "localhost:8500", - Scheme: "http", + Addr: "", + Scheme: "", KVPath: "/fabio/config", NoRouteHTMLPath: "/fabio/noroute.html", TagPrefix: "urlprefix-",