From ca4d8f8eb51aab2c2509c6141b322aeefb0e7ba3 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Sat, 24 Dec 2022 17:57:59 +0100 Subject: [PATCH] Route fix --- consul/discovery.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/consul/discovery.go b/consul/discovery.go index 943c5e3..8c7d9a7 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -146,20 +146,15 @@ func (s *Service) getTags() []string { "traefik.http.routers." + s.Name + ".entryPoints=https", "traefik.http.routers." + s.Name + ".tls=true", "traefik.http.routers." + s.Name + ".service=" + s.Name, - "traefik.http.routers." + s.Name + ".middlewares=requestid,compress,stripprefix", + "traefik.http.routers." + s.Name + ".middlewares=requestid,compress,stripprefix_" + 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.middlewares.requestid.plugin.requestid.headerName=X-Request-ID", - "traefik.http.middlewares.stripprefix.stripprefix.prefixes=" + s.pathPrefix, - "traefik.http.middlewares.compress.compress=true", - // "traefik.http.middlewares.cors.headers.accesscontrolallowmethods=*", - // "traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist=*", - // "traefik.http.middlewares.cors.headers.accessControlExposeHeaders=true", - // "traefik.http.middlewares.cors.headers.accesscontrolmaxage=100", - // "traefik.http.middlewares.cors.headers.addvaryheader=true", + "traefik.http.middlewares.stripprefix_" + s.Name + ".stripprefix.prefixes=" + s.pathPrefix, "traefik.tls.certificates.certfile=/certs/client.cert", "traefik.tls.certificates.keyfile=/certs/client.key", + // "traefik.http.middlewares.compress.compress=true", // "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",