Haproxy: send custom http response when maxconn is hit
Is it possible to send a custom http response back from Haproxy if the load balancer hits maxconn?开发者_开发技巧
My intention is to send a busy tone equivalent (but not 503) if the server is busy.
The errorfile keyword may be used in your configuration for this:
errorfile 503 /etc/haproxy/errors/503.http
Where 503.http is something like:
HTTP/1.0 503 Service Unavailable^ Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>503 Service Unavailable</h1>
Sorry, no server is available to handle this request.
</body></html>
精彩评论