Compare commits

..

8 Commits

Author SHA1 Message Date
cd6e62e3bc debug fix 2024-07-20 16:17:13 +02:00
7cf2d91fd8 debug fix 2024-07-20 16:15:20 +02:00
936982731d debug fix 2024-07-20 16:11:06 +02:00
33759c87db debug fix 2024-07-20 15:56:59 +02:00
974f82e9be debug fix 2024-07-20 15:53:05 +02:00
d7dc75c18f debug fix 2024-07-20 15:45:49 +02:00
c62c63249c debug fix 2024-07-20 14:44:45 +02:00
6c290eb66b tls fix 2024-07-20 14:43:47 +02:00

View File

@@ -70,12 +70,11 @@ func (s *Service) GetID() string {
}
func (s *Service) GetFullAddr() string {
isTLS := s.port == 443
proto := "http"
if isTLS {
if s.tls {
proto = "https"
}
return fmt.Sprintf("%s://%s:%d/", proto, s.Address, s.port)
return fmt.Sprintf("%s://%s:%d/", proto, s.domain, s.port)
}
func (s *Service) Register() error {
@@ -160,7 +159,7 @@ func (s *Service) healthCheck() (bool, error) {
alive := func() bool {
client := &http.Client{}
healthUrl := fmt.Sprintf("%s%s?name=%s", s.GetFullAddr(), "health", s.Name)
fmt.Printf("HealthCheck URL: %s%s?name=%s", s.GetFullAddr(), "health", s.Name)
// fmt.Printf("HealthCheck URL: %s%s?name=%s", s.GetFullAddr(), "health", s.Name)
req, err := http.NewRequest(http.MethodGet, healthUrl, nil)
if err != nil {
return false
@@ -214,10 +213,10 @@ func (s *Service) getTags() []string {
"traefik.http.services." + s.Name + ".loadbalancer.server.scheme=https",
"traefik.http.services." + s.Name + ".loadbalancer.server.port=" + strconv.Itoa(s.port),
"traefik.http.services." + s.Name + ".loadbalancer.passhostheader=true",
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.interval=1s",
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.interval=5s",
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.timeout=1s",
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.path=/health",
"traefik.tls.certificates.certfile=certs/client.cert",
"traefik.tls.certificates.certfile=certs/client.crt",
"traefik.tls.certificates.keyfile=certs/client.key",
}