1

如果负载均衡器达到 maxconn,是否可以从 Haproxy 发回自定义 http 响应?

如果服务器忙,我的意图是发送等效的忙音(但不是 503)。

4

1 回答 1

2

errorfile关键字可以在您的配置中使用:

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

<html><body><h1>503 Service Unavailable</h1>
Sorry, no server is available to handle this request.
</body></html>
于 2011-11-07T07:16:03.317 回答