I would like haproxy to use its own 503 document page when back server (backend) sends HTTP 503 code. Is it possible?
Have seen something like "monitor fail" conditions but don't know how to add it to the frontend.
haproxyhttp-status-code
I would like haproxy to use its own 503 document page when back server (backend) sends HTTP 503 code. Is it possible?
Have seen something like "monitor fail" conditions but don't know how to add it to the frontend.
Best Answer
You can use the
errorfile
directive and then a custom.http
text file. So for example:Content of the file would then be something like:
The
errorfile
directive can be specific to a backend as well.The "errorfile" setting cannot be used to change a response sent by HAProxy if nodes are online. This setting only affects HAProxy when all nodes are offline.