How to increase Apache mod_proxy Jetty 5minute timeout

apache-2.4jettymod-proxytimeout

we use Apache and Jetty to do install components behind a firewall. Some actions take a while ( 10-15 minutes ). Apache is the proxy and Jetty is the proxy target on some machines. Everything works fine for actions taking less than 5 minutes. Actions taking longer than 5 minutes fail with a 502 proxy error.

I have seen some similar topics and the advice was to define timeout and keepalive – both did not help.

our setup ist:

Windows 2012R2
Apache 2.4.9
Jetty 7

Initially I forgot to mention that there is a firewall between the apache and the Jetty.

In apache httpd.conf we have:

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

We hoped that timeout=3000 ( 3000 seconds ) would keep Apache waiting for about 50 minutes for the response from Jetty. Keepalive and and ttl are trials …

On Jetty we are calling a simple Groovy script that simply sits and waits for a long time. If the waittime is small this works as expected. If the waittime is beyond 5minutes we get an error:

Apache Access: ( the request starts at 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

As you can see the duration is about 5Minutes ~ 300509428 and thus a timeout – it should have lastet for 10 minutes.

Apache Error: ( the request times out at 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

Any ideas how to do to keep Apache waiting for a longer time ??

Best Answer

You might try using quotes around the regex and url, as indicated in the Apache documentation, while leaving the key value pairs without quotes.

Example

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

It may be that without the quotes, the server is not reading the ProxyPassMatch as you intend and does not recognize where the basic parameters end and the key values begin.