From e5786be62be5dfe03ebd93c80dcc6670f7e9b142 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 1 Dec 2022 09:24:11 +0100 Subject: [PATCH] backend server url fix --- consul/discovery.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consul/discovery.go b/consul/discovery.go index b3cf31d..68533b4 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -112,6 +112,7 @@ func (s *Service) check() (bool, error) { func (s *Service) getTags() []string { fullName := fmt.Sprintf("%s_%s", s.Name, s.AppID) + bFullAddr := fmt.Sprintf("http://%s:%d", s.IP, s.Port) tags := []string{ "traefik.enable=true", @@ -122,7 +123,7 @@ func (s *Service) getTags() []string { "traefik.http.routers." + s.Name + ".tls=true", // "traefik.http.services." + s.Name + ".loadbalancer.server.scheme=http", // "traefik.http.services." + s.Name + ".loadbalancer.server.port=" + port, - "traefik.http.services." + s.Name + ".loadbalancer.servers." + fullName + "=" + s.Address, + "traefik.http.services." + s.Name + ".loadbalancer.servers." + fullName + "=" + bFullAddr, "traefik.http.services." + s.Name + ".loadbalancer.passhostheader=false", "traefik.http.middlewares.compress.compress=true", "traefik.http.middlewares.requestid.plugin.requestid.headerName=X-Request-ID",