HAProxy – Enable maintenance mode if file exists

haproxyload balancing

We're using stunnel and HAProxy for our load balancing needs.

In nginx you can enable a maintenance state, based on the existance of a file on a child server (see Configure nginx to serve a 503 if a file exists).

Is it possible to put a server node into 'maintenance mode' based on the existance of a file, when using HAProxy?

Best Answer

Yes you can.

If the health check file is missing. Check the disable-on-404 option.