From 73d302d2c37aeb82e461b4462993bb895ae22d0d Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 1 Dec 2022 19:05:59 +0100 Subject: [PATCH] register fix --- consul/discovery.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/consul/discovery.go b/consul/discovery.go index decfbd8..e5cb559 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "net/http" + "strconv" "time" consul "github.com/hashicorp/consul/api" @@ -119,18 +120,18 @@ func (s *Service) getTags() []string { "traefik.enable=true", "traefik.http.routers." + s.Name + ".rule=Host(`" + s.Address + "`)", "traefik.http.routers." + s.Name + ".entryPoints=https", - // "traefik.http.routers." + s.Name + ".tls=true", - // "traefik.http.routers." + s.Name + ".service=" + s.Name, - // "traefik.http.services." + s.Name + ".loadbalancer.server.scheme=http", - // "traefik.http.services." + s.Name + ".loadbalancer.server.port=" + strconv.Itoa(s.Port), - // "traefik.http.services." + s.Name + ".loadbalancer.passhostheader=false", + "traefik.http.routers." + s.Name + ".tls=true", + "traefik.http.routers." + s.Name + ".service=" + s.Name, + "traefik.http.routers." + s.Name + ".middlewares=compress,requestid", + "traefik.http.services." + s.Name + ".loadbalancer.passhostheader=false", + "traefik.http.services." + s.Name + ".loadbalancer.server.scheme=http", + "traefik.http.services." + s.Name + ".loadbalancer.server.port=" + strconv.Itoa(s.Port), + "traefik.http.middlewares.compress.compress=true", + "traefik.http.middlewares.requestid.plugin.requestid.headerName=X-Request-ID", // "traefik.http.services." + s.Name + ".loadbalancer.servers." + fullName + "=" + bFullAddr, // "traefik.http.services." + s.Name + ".loadbalancer.servers." + fullName + ".url=" + bFullAddr, // "traefik.http.services." + s.Name + ".loadbalancer.healthcheck.path=/health", // "traefik.http.services." + s.Name + ".loadbalancer.healthcheck.interval=10s", - // "traefik.http.routers." + s.Name + ".middlewares=compress,requestid", - // "traefik.http.middlewares.compress.compress=true", - // "traefik.http.middlewares.requestid.plugin.requestid.headerName=X-Request-ID", } return tags