Is there an easy way to dissable All backends in haproxy, and instead serve an appropriate maintenance page (for http requests)?
I've read a little about the dissabled option, which I understand is per-server, but am wondering if there is a way to simply stop traffic to all backends?
Best Answer
The
backup
keyword is what we use for this. See this example:Here both servers
web01
andweb02
are set todisabled
, in which case thebackup
serverprx
on 10.1.31.10:9000 will be used, which serves a maintenance page. Theprx
server in our case is the HAProxy server itself and on port 9000 runs an Apache HTTPD, serving the maintenance content: