Is it possible to setup custom error pages in haproxy but only when the backend does not respond. ie when the backend is down haproxy sends out 503 error pages. We want our multidomain haproxy to send 503 error pages matching the domain requested.
We have tried setting up custom error pages like so:
http-errors domain1
errorfile 503 /etc/haproxy/errors/503_domain1.http
http-errors domain2
errorfile 503 /etc/haproxy/errors/503_domain.http
and in the frontend like so:
http-response return status 503 errorfiles domain1 if { status 503 } { var(txn.host) www.domain1.com }
http-response return status 503 errorfiles domain2 if { status 503 } { var(txn.host) domain2.com }
But that overrides all 503 error pages, also the ones sent from the backend and any custom headers set by the backend. We only want haproxy to send its own custom error pages if the backend does not respond. Is this possible?
1 post - 1 participant