0

I’m using Apache 2.2 and JBoss 7.1.3.Final. I’m connected to JBoss from Apache via AJP. Below is my configuration …

ProxyPass /cloudfront/ ajp://localhost:8009/cloudfront/

ProxyPass /app1/resources/ !  
ProxyPass /app1/ ajp://localhost:8009/app1/ connectiontimeout=300 timeout=300

ProxyPass /app2/ ajp://localhost:8009/app2/

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule !/status.html https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

RewriteCond %{REQUEST_METHOD} !POST
ReWriteRule ^(.*);jsessionid=.*$ https://%{SERVER_NAME}$1 [L,R=301]

ProxyTimeout 600

When I try and connect to /app1 through a browser, I get a timeout (504 GATEWAY_TIMEOUT error) after about a minute. I have confirmed I have extended teh client timeout on Firefox for instance, to 600 seconds. Is there anything else wrong in the configuration above that is preventing extending the timeout period longer than a minute?

Dave
  • 185
  • 1
  • 7
  • 20
  • Well you are explicitly overriding the 600 seconds timeout on your `ProxyPass` line (reducing it to 300 seconds), Also the underlying service may implement its own timeout, so check that too. – Unbeliever Nov 25 '16 at 09:46
  • Even if the override were working, the override is set to 5 minutes and I'm getting timeouts after 1 minute. The underlying service is JBoss ... so by your reasoning, if I ran teh request against JBoss directly (bypassing Apache), then I should see the timeout, is that correct? – Dave Nov 28 '16 at 15:01
  • I agree the 60 second timeout doesn't make sense, I was just commenting about the 300/600 configuration. It maybe worth changing the log level to debug and then look if anything interesting appears in the error log. At the moment I can't see any reason for what you are describing. ALso maybe worth increasing the log level on the JBOSS side. – Unbeliever Nov 28 '16 at 17:06
  • The JBoss log shows a "ClientAbortException: java.net.SocketException: Connection reset" after about a minute (I do not see this error when I run the request directly against JBoss). Maybe there's some other Unix setting I'm not thinking of? – Dave Nov 28 '16 at 18:20
  • Well there certainly doesn't seem to be anything wrong with your Apache config. You only have 3 options, the `Timeout` directive which is overridden by the `ProxyTimeout` directive which is overridden by the `timeout` option on the ProxyPass line. 60 is the tomcat connection timeout, but that s the timeout between a connection being made and the request URI being sent, which is normally extremely quick. – Unbeliever Nov 28 '16 at 23:13
  • The missing piece was there was an Amzon-hosted load balacner in front of all this. We had to adjust the timeout there as well and then things started working. – Dave Nov 30 '16 at 21:55
  • Well you didn't mention that :-) – Unbeliever Dec 01 '16 at 01:35

0 Answers0