参考記事
HOWTO use haproxy custom 503 error document when back server sends 503 http code
やり方としては、haproxy.confのdefaultセクション等にステータスコードごとに表示したいファイルのパスを書くだけです。
(defaults,frontend,listen,backendセクションにかけるようです)
haproxy.conf
defaults
errorfile 404 /etc/haproxy/errors/404.http
errorfile 503 /etc/haproxy/errors/503.http
503.http
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="utf-8">
</meta>
</head>
<body>
hogehoge
</body>
</html>
ファイルの内容を変更した場合は、restartしないと反映されません。