开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜