Apache ProxyPass 是否可以在后端连接失败时重试请求

Apache ProxyPass 是否可以在后端连接失败时重试请求

我使用 Apache 作为应用服务器层的反向代理 - 使用 ProxyPass。

应用服务器是单实例(无负载平衡)。

Apache 会定期(可能是由于某些较低级别的网络问题)记录以下错误。

[Mon Jul 10 12:48:43.491680 2017] [proxy_http:error] [pid 17325:tid 139862111938304] [client x.x.x.x:21241] AH01114: HTTP: failed to make connection to backend: prod_java, referer: https://my.company.com/app/request

并向客户端返回 503 服务不可用响应。

我正在考虑设置以下内容以更快地对连接失败做出反应:

ProxyPass /app http://PROD_JAVA:8080/app connectiontimeout=1 retry=0 keepalive=On

我的问题是 - 在出现这种故障的情况下,有没有办法让 Apache 再次向后端重试请求 - 而不是立即回复客户端?

相关内容