Ping

Checking the Health of Your Traefik Instances

Configuration Examples

To enable the API handler:

File (TOML)

  1. [ping]

File (YAML)

  1. ping: {}

CLI

  1. --ping=true

Configuration Options

The /ping health-check URL is enabled with the command-line --ping or config file option [ping].

The entryPoint where the /ping is active can be customized with the entryPoint option, whose default value is traefik (port 8080).

PathMethodDescription
/pingGET, HEADA simple endpoint to check for Traefik process liveness. Return a code 200 with the content: OK

Note

The cli comes with a healthcheck command which can be used for calling this endpoint.

entryPoint

Optional, Default=”traefik”

Enabling /ping on a dedicated EntryPoint.

File (TOML)

  1. [entryPoints]
  2. [entryPoints.ping]
  3. address = ":8082"
  4. [ping]
  5. entryPoint = "ping"

File (YAML)

  1. entryPoints:
  2. ping:
  3. address: ":8082"
  4. ping:
  5. entryPoint: "ping"

CLI

  1. --entryPoints.ping.address=:8082
  2. --ping.entryPoint=ping

manualRouting

Optional, Default=false

If manualRouting is true, it disables the default internal router in order to allow one to create a custom router for the ping@internal service.

File (TOML)

  1. [ping]
  2. manualRouting = true

File (YAML)

  1. ping:
  2. manualRouting: true

CLI

  1. --ping.manualrouting=true

terminatingStatusCode

Optional, Default=503

During the period in which Traefik is gracefully shutting down, the ping handler returns a 503 status code by default. If Traefik is behind e.g. a load-balancer doing health checks (such as the Kubernetes LivenessProbe), another code might be expected as the signal for graceful termination. In which case, the terminatingStatusCode can be used to set the code returned by the ping handler during termination.

File (TOML)

  1. [ping]
  2. terminatingStatusCode = 204

File (YAML)

  1. ping:
  2. terminatingStatusCode: 204

CLI

  1. --ping.terminatingStatusCode=204