Skip to content

Health monitoring

yusing edited this page Feb 6, 2025 · 7 revisions

Health monitoring

Behaviors

  • Health monitoring is enabled by default for all proxied services
  • If docker healthcheck is enabled, it will be used first. In this case, use_get and path will be ignored.
  • In case docker healthcheck is not available (not enabled / failed to fetch), GoDoxy healthcheck will be used.

Implementation

HTTP healthcheck

For HTTP healthcheck, GoDoxy uses HEAD (or GET if use_get is enabled) to send a request to the specified path.

When server reply any result (even if status code is not 200), GoDoxy assumes the service is healthy.

Otherwise (e.g. connection refused or timed out), GoDoxy assumes the service is unhealthy.

TCP/UDP healthcheck

For TCP/UDP healthcheck, GoDoxy uses dials a TCP/UDP connection to upstream server.

When connection is established, GoDoxy assumes the service is healthy.

Otherwise, GoDoxy assumes the service is unhealthy.

File server healthcheck

For file server healthcheck, GoDoxy checks if the root directory exists and is accessible by GoDoxy with os.Stat.

Properties

Property Description Default Allowed Values / Syntax
disable disable health monitoring false boolean
path relative path (HTTP/s only) empty empty or URI like /health
use_get use GET method instead of HEAD (HTTP/s only) false boolean
interval health check interval 5s duration
timeout health check timeout 5s duration

Examples

Docker compose

services:
  qbittorrent:
    container_name: qbt
    image: nginx
    labels:
      proxy.qbt.healthcheck.use_get: true
    restart: unless-stopped

Route file

qbt:
  host: 10.0.0.1
  port: 8080
  healthcheck:
    use_get: true