如果负载均衡器达到 maxconn,是否可以从 Haproxy 发回自定义 http 响应?
如果服务器忙,我的意图是发送等效的忙音(但不是 503)。
如果负载均衡器达到 maxconn,是否可以从 Haproxy 发回自定义 http 响应?
如果服务器忙,我的意图是发送等效的忙音(但不是 503)。
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>