diff --git a/consul/discovery.go b/consul/discovery.go index b82bd67..41d98c7 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -178,6 +178,12 @@ func (s *Service) healthCheck() (bool, error) { func (s *Service) getTags() []string { tags := []string{ "traefik.enable=true", + "traefik.http.middlewares.auth_" + s.Name + ".plugin.auth.handlerURL=" + config.GetEnv("AUTH_HANDLER_URL", ""), + // "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.authRequestHeaders=Cookie", + // "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.authResponseHeaders=Set-Cookie, Server", + // "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.trustForwardHeader=true", + "traefik.http.middlewares.requestid_" + s.Name + ".plugin.requestid.headerName=X-Request-ID", + "traefik.http.middlewares.stripprefix_" + s.Name + ".stripprefix.prefixes=" + s.pathPrefix, "traefik.http.routers." + s.Name + ".rule=PathPrefix(`" + s.pathPrefix + "`)", // "traefik.http.routers." + s.Name + ".rule=Host(`" + s.domain + "`)", "traefik.http.routers." + s.Name + ".entryPoints=https", @@ -188,12 +194,6 @@ func (s *Service) getTags() []string { "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.auth_" + s.Name + ".plugin.auth.handlerURL=" + config.GetEnv("AUTH_HANDLER_URL", ""), - // "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.authRequestHeaders=Cookie", - // "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.authResponseHeaders=Set-Cookie, Server", - // "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.trustForwardHeader=true", - "traefik.http.middlewares.requestid_" + s.Name + ".plugin.requestid.headerName=X-Request-ID", - "traefik.http.middlewares.stripprefix_" + s.Name + ".stripprefix.prefixes=" + s.pathPrefix, "traefik.tls.certificates.certfile=/certs/client.cert", "traefik.tls.certificates.keyfile=/certs/client.key", }