This is a discussion on mod_jk with keepalives within the Apache Web Server forums, part of the Web Server and Related Forums category; I'm trying to get keepalives working with mod_jk and mod_rewrite with a proxy rule. I work in a highly ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm trying to get keepalives working with mod_jk and mod_rewrite with a
proxy rule. I work in a highly customized environment so I'm limited in the solutions I can implement and the changes I can make. I had mod_jk and keepalives working just fine with a mod_rewrite, with a rule similar to the following, RewriteRule ^/app1/(.*)$ http://%{SERVER_NAME}/app2/$1 [L,NC,R] The problem is we have a home grown application that doesn't understand what to do when it sees a redirect. So even though I can specify the return code for redirect, like R=$num, I can't use that solution because the browser still wouldn't know to follow the redirect. So I could feed it a 200 status, the problem is the browser won't follow the redirect, so it would just display the page that gave it a 200, telling it to redirect. So my thought is to use mod_rewrite with a proxy rule like this, RewriteRule ^/app1/(.*)$ http://%{SERVER_NAME}/app2/$1 [P] The problem I'm having is that when I set up that proxy rule, keepalives stop working on the pages that get sent to tomcat through mod_jk. I also tried using ProxyPass and ProxyPassReverse but my keepalives stopped working with those connections too. Does anyone know of a method that can make this happen where keepalives will continue to work? |
|
|||
|
rick wrote: > I'm trying to get keepalives working with mod_jk and mod_rewrite with a > proxy rule. I work in a highly customized environment so I'm limited > in the solutions I can implement and the changes I can make. > > I had mod_jk and keepalives working just fine with a mod_rewrite, with > a rule similar to the following, > RewriteRule ^/app1/(.*)$ http://%{SERVER_NAME}/app2/$1 [L,NC,R] > > The problem is we have a home grown application that doesn't understand > what to do when it sees a redirect. So even though I can specify the > return code for redirect, like R=$num, I can't use that solution > because the browser still wouldn't know to follow the redirect. So I > could feed it a 200 status, the problem is the browser won't follow the > redirect, so it would just display the page that gave it a 200, telling > it to redirect. > > So my thought is to use mod_rewrite with a proxy rule like this, > RewriteRule ^/app1/(.*)$ http://%{SERVER_NAME}/app2/$1 [P] > > The problem I'm having is that when I set up that proxy rule, > keepalives stop working on the pages that get sent to tomcat through > mod_jk. I also tried using ProxyPass and ProxyPassReverse but my > keepalives stopped working with those connections too. Does anyone > know of a method that can make this happen where keepalives will > continue to work? does this home grown application that doesnt under redirects have a user-agent tag you can match and force keepalives as in the workarounds section for broken browsers: http://httpd.apache.org/docs/2.0/env.html#examples |
|
|||
|
shimmyshack wrote: > does this home grown application that doesnt under redirects have a > user-agent tag you can match and force keepalives as in the workarounds > section for broken browsers: > http://httpd.apache.org/docs/2.0/env.html#examples There is a user-agent tag that can be matched. Unfortunately, all connections that apache handles are able to maintain keepalives. I'm even able to maintain keepalives when I pass the traffic through mod_jk to tomcat when using a mod_rewrite redirect rule. The keepalives stop working when I use a mod_rewrite proxy rule, which is the type of rule I need in place in order to have the browser successfully pull up the pages. I'm wondering if other than using proxy, there is some sort of mod_jk configuration that can be put in place that would handle this. |
|
|||
|
"rick" <devrick88@gmail.com> schreef in bericht
news:1165335263.980784.18360@n67g2000cwd.googlegro ups.com... > I'm trying to get keepalives working with mod_jk and mod_rewrite with a > proxy rule. I work in a highly customized environment so I'm limited > in the solutions I can implement and the changes I can make. > > I had mod_jk and keepalives working just fine with a mod_rewrite, with > a rule similar to the following, > RewriteRule ^/app1/(.*)$ http://%{SERVER_NAME}/app2/$1 [L,NC,R] You want requests for one folder diverted to another folder. The latter folder is proxied by mod_jk to tomcat. Your home grown application is -in HTTP terms- a client -acting like a browser-. Did I get the picture or am I way off ? > The problem is we have a home grown application that doesn't understand > what to do when it sees a redirect. > So even though I can specify the > return code for redirect, like R=$num, I can't use that solution > because the browser still wouldn't know to follow the redirect. So I > could feed it a 200 status, the problem is the browser won't follow the > redirect, so it would just display the page that gave it a 200, telling > it to redirect. Breaking HTTP response code is generally a bad idea. Give this a try RewriteRule ^/app1/(.*)$ /app2/$1 [L,NC,QSA,PT] it should keep your client application ignorent about the divertion to app2, while forwarding the querry string [QSA] and passing thrue a modified url to mod_jk [PT] HansH |
|
|||
|
HansH wrote: > Give this a try > RewriteRule ^/app1/(.*)$ /app2/$1 [L,NC,QSA,PT] > it should keep your client application ignorent about the divertion to app2, > while forwarding the querry string [QSA] and passing thrue a modified url to > mod_jk [PT] > > HansH Perfect! That did the trick. Believe me, I was up in arms about the way the web browsing application handled all traffic other than 200 http status codes. However until the application gets fixed, I had to find some way to make it work. Thank you! |