From 0e619369fd6f6a49c6fb223a129bd6d786c83fa2 Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Wed, 6 Dec 2017 11:20:03 +0100 Subject: [PATCH] fix healthcheck when web is not specified --- cmd/traefik/healthcheck.go | 7 +++++-- docs/basics.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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