All Collections SSL & Caddy Health Checks

Health Checks

Load balance applications can use health checks to route traffic around affected servers

Updated

Health checks can be very useful for keeping large applications up. If a server goes down or is taken out for maintenance, the load balancer can skip these servers while routing traffic.

Enabling Health Checks

First, your cluster needs a server with the "Load Balancer" role.

Then, add a Health Check URI to your application(s) in the cluster.

How Health Checks Work

Requests will be sent to each web server in the cluster on an regular interval to check their status. Health checks are sent over HTTP since SSL is stripped at the load balancer. Since web servers also run Caddy, they will reverse proxy the request to your application to check it's health.

Testing Health Checks Manually

You can SSH into the load balancer server and use curl to test a health check endpoint on a web server.

curl http://PRIVATEIP/up -H "Host: domain.com" -H "X-Forwarded-Proto: https"

You'll need to use the private IP address of a web server and change the Host header to use a domain registered to the app in Hatchbox.