Advanced Topics
Health monitoring
Configure health monitoring for GoDoxy
Behaviors
- Health monitoring is enabled by default for all services, including the excluded ones.
- If docker healthcheck1 is enabled, it is the primary check. A valid Docker result is authoritative, so
use_getandpathare ignored and GoDoxy does not probe the upstream. - If a docker healthcheck is not configured or Docker cannot perform the check because of a client initialization, API, decoding, or timeout failure, the GoDoxy healthcheck is used as a fallback while Docker is retried on later intervals.
- You can disable GoDoxy health probing by setting
healthcheck.disable: truein the route file2 or in the docker labels3. To disable it for every route of a Docker container, setproxy.exclude: healthcheck4. Docker health monitoring remains enabled for Docker routes.
References
-
Health check in Docker compose and Dockerfile, e.g.
healthcheck: test: ["CMD", "curl", "-f", "http://localhost"] interval: 1m30s timeout: 10s retries: 3 start_period: 40s start_interval: 5s -
Disable GoDoxy health probing in route file
app: host: 10.0.0.1 port: 8080 healthcheck: disable: true -
Docker labels
services: app: labels: proxy.#1.healthcheck.disable: true -
Every route of a Docker container
services: app: labels: proxy.exclude: healthcheckUse
proxy.exclude: proxy,healthcheckorproxy.exclude: allto exclude the routes from proxying as well. The boolean valuetrueexcludes only proxying for backward compatibility.
Implementations
| Healthcheck Type | Method | Healthy Condition | Unhealthy Condition |
|---|---|---|---|
| HTTP | Sends HEAD or GET request to specified path (default: /) | Server replies with a non-5xx HTTP response | Connection failure/error, 5xx reply |
| TCP/UDP | Dials a TCP or UDP connection to upstream server | Connection is established | Connection cannot be established |
| File Server | Checks if root directory exists and is accessible by GoDoxy (os.Stat) | Root directory exists and is accessible | Otherwise |
Properties
| Property | Description | Default | Allowed Values / Syntax |
|---|---|---|---|
| disable | Disable GoDoxy probing (Docker health remains) | false | boolean |
| path | Relative path (HTTP only) | empty | empty or URI like /health |
| use_get | Use GET method instead of HEAD (HTTP only) | false | boolean |
| interval | Health check interval | 5s | duration |
| timeout | Health check timeout | 5s | duration |
| retries | Health check retries before notifying unhealthy | 15s divided by interval | integer |