如何增加Apache mod_proxy Jetty 5分钟超时

我们使用Apache和Jetty在防火墙后面安装组件。 一些行动需要一段时间(10-15分钟)。 Apache是​​代理,Jetty是一些机器上的代理目标。 一切工作正常采取less于5分钟的行动。 花费超过5分钟的操作失败,出现502代理错误。

我看过一些类似的主题,build议是定义超时和保持活动 – 两者都没有帮助。

我们的设置是:

Windows 2012 R2 Apache 2.4.9 Jetty 7

最初我忘了提及apache和Jetty之间有防火墙。

在Apache的httpd.conf中我们有:

ProxyPassMatch ^/([a-z0-9\-]+)/(.+)$ http://$1:3000/$2 timeout=3000 ttl=3000 Keepalive=On 

我们希望timeout = 3000(3000秒)可以让Apache等待Jetty响应50分钟。 Keepalive和ttl正在尝试…

在Jetty上,我们正在调用一个简单的Groovy脚本,它只是坐等待很长时间。 如果等待时间很短,则按预期工作。 如果等待时间超过5分钟,我们会得到一个错误:

Apache访问:(请求在17:25开始)

 xxx.xxx.xxx.xxx- - [02/Apr/2016:17:25:47 +0200] "GET /server/scripts/waitlong.groovy HTTP/1.1" 502 445 "-" 300509428 "-" "10.119.1.20" 10.119.1.20 3000 

正如你所看到的持续时间大约是5分钟〜300509428,因此超时 – 它应该有10分钟的时间。

Apache错误:(请求在17:30超时)

 [Sat Apr 02 17:30:47.815050 2016] [proxy_http:error] [pid 11656:tid 12736] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. : [client 10.119.1.20:60466] AH01102: error reading status line from remote server w-bidb1hf:3000 [Sat Apr 02 17:30:47.815050 2016] [proxy:error] [pid 11656:tid 12736] [client 10.119.1.20:60466] AH00898: Error reading from remote server returned by /w-bidb1hf/scripts/waitlong.groovy 

任何想法如何保持Apache等待更长时间?

您可以尝试在正则expression式和url中使用引号,如Apache文档中所示 ,而不使用引号保留键值对。

ProxyPass“/ example”“ http://backend.example.com ”max = 20 ttl = 120 retry = 300

可能是因为没有引号,服务器没有按照您的意图读取ProxyPassMatch,而是无法识别基本参数结束和键值开始的位置。