Hello, I would like to set a server status as maint by default.
Right now I’m using the API to set that but when Haproxy restarts I would like maint to by the default mode.
Is that possible?
Hello, I would like to set a server status as maint by default.
Right now I’m using the API to set that but when Haproxy restarts I would like maint to by the default mode.
Is that possible?
You can use default_backend in the defaults
, frontend
or listen
section.
Syntax: default_backend <backend>
And then you can use use_backend in the frontend
or listen
section.
Syntax: use_backend <backend> [{if | unless} <condition>]
Example:
listen http
mode http
bind *:80
use_backend prod if x
default_backend maint
backend maint
http-request return status 400 content-type text/plain string "Maint mode!"
backend prod
http-request return status 200 content-type text/plain string "Production mode!"
`