fix healthcheck when web is not specified
This commit is contained in:
parent
6333bfe6e8
commit
0e619369fd
2 changed files with 6 additions and 3 deletions
|
@ -64,6 +64,9 @@ func healthCheck(globalConfiguration configuration.GlobalConfiguration) (*http.R
|
||||||
}
|
}
|
||||||
client.Transport = tr
|
client.Transport = tr
|
||||||
}
|
}
|
||||||
|
path := "/"
|
||||||
return client.Head(protocol + "://" + pingEntryPoint.Address + globalConfiguration.Web.Path + "ping")
|
if globalConfiguration.Web != nil {
|
||||||
|
path = globalConfiguration.Web.Path
|
||||||
|
}
|
||||||
|
return client.Head(protocol + "://" + pingEntryPoint.Address + path + "ping")
|
||||||
}
|
}
|
||||||
|
|
|
@ -620,7 +620,7 @@ This command allows to check the health of Traefik. Its exit status is `0` if Tr
|
||||||
This can be used with Docker [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#healthcheck) instruction or any other health check orchestration mechanism.
|
This can be used with Docker [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#healthcheck) instruction or any other health check orchestration mechanism.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
The [`web` provider](/configuration/backends/web) must be enabled to allow `/ping` calls by the `healthcheck` command.
|
The [`ping`](/configuration/ping) must be enabled to allow the `healthcheck` command to call `/ping`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
traefik healthcheck
|
traefik healthcheck
|
||||||
|
|
Loading…
Reference in a new issue