diff --git a/cmd/traefik/healthcheck.go b/cmd/traefik/healthcheck.go index 876d0d04f..9f926dd6f 100644 --- a/cmd/traefik/healthcheck.go +++ b/cmd/traefik/healthcheck.go @@ -64,6 +64,9 @@ func healthCheck(globalConfiguration configuration.GlobalConfiguration) (*http.R } client.Transport = tr } - - return client.Head(protocol + "://" + pingEntryPoint.Address + globalConfiguration.Web.Path + "ping") + path := "/" + if globalConfiguration.Web != nil { + path = globalConfiguration.Web.Path + } + return client.Head(protocol + "://" + pingEntryPoint.Address + path + "ping") } diff --git a/docs/basics.md b/docs/basics.md index ffe71ec84..76fc323c3 100644 --- a/docs/basics.md +++ b/docs/basics.md @@ -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. !!! 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 traefik healthcheck