Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread Bocalinda
Hey Nick. http://172.18.0.39:8080 is the URL of one of my Tomcat servers. Not my load balancer. That's what I mean with hardcoded. I cannot put the URL of the load balancer, as I have 2 Tomcat clusters being served by the same load balancer. Each cluster runs a differe

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread Nick Kew
On Mon, 17 Nov 2008 13:38:21 +0100 Bocalinda <[EMAIL PROTECTED]> wrote: > >ProxyPass balancer://mycluster1 stickysession=JSESSIONID >ProxyPassReverse / >SetOutputFilter proxy-html >ProxyHTMLURLMap (.*\.gif) http://172.18.0.39:8080/$1 Rie > > > This works, however

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread Bocalinda
Sounds perfect. I don't mind having to add a new entry each time I have a new application, since I need to do the same in order to make the application load balance. I wonder if there would be a way to have a default load balancing route.. :) 2008/11/18 André Warnier <[EMAIL PROTECTED]> > Well th

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread André Warnier
Well then, not to overdo it, but you can use either this RewriteRule ^/(SEDO-NEW|SEDO|ABCD|XYZ)?)$ $1/index.jsp [R=301,L] (and keep on adding alternatives as need be) or this RewriteRule ^/(SEDO)$ $1/index.jsp [R=301,L] RewriteRule ^/(SEDO-NEW)$ $1/index.jsp [R=301,L] RewriteRule ^/(ABCD)$ $1/ind

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread Bocalinda
Hi André. Yes, for now just those two applications are involved. However, it might be that new applications will be added. Thanks a bunch for the tip though! 2008/11/18 André Warnier <[EMAIL PROTECTED]> > Hi. > Now in your case, it was just the 2 URLs "/SEDO" and "/SEDO-NEW" that > needed to be

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread André Warnier
Hi. Now in your case, it was just the 2 URLs "/SEDO" and "/SEDO-NEW" that needed to be rewritten and cause a re-direct, no ? If so, you could use the following RewriteRule, which should not have these inconvenients : RewriteRule ^/(SEDO(-NEW)?)$ $1/index.jsp [R=301,L] Bocalinda wrote: Hey g

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-18 Thread Bocalinda
Hey guys, There is one problem with this solution. RewriteRule ^/([^/]+)$ $1/ [R=301,L] http://172.18.0.1/SEDO/test.html will also be added a trailing slash. I changed the regular expression to NOT add a trailing slash if there is a dot in the string. RewriteRule ^/([^/\.]+)$ $1/ [R=301,L] Let

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Bocalinda
Hi André and Dan, Thanks a lot, this solved my problem! Just one question Dan. >Apache will (in the default configuration) redirect /SEDO to /SEDO/ (if 'SEDO' is a directory). If you're proxying back, Apache won't >know that obviously, but you can use a rewrite rule to simulate this: Sorry for

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Dan Udey
You could also, in order to keep the URLs pretty and SEO and whatnot, just add an extra / on the end. Apache will (in the default configuration) redirect /SEDO to /SEDO/ (if 'SEDO' is a directory). If you're proxying back, Apache won't know that obviously, but you can use a rewrite rule to

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread André Warnier
André Warnier wrote: Bocalinda wrote: Yes, that would be /SEDO/index.jsp Ok, now a simple test : When, instead of requesting http://yourserversip/SEDO if you request in your browser http://yourserversip/SEDO/index.jsp then your relative image links are working, right ? (provided the images are

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread André Warnier
Bocalinda wrote: Yes, that would be /SEDO/index.jsp Ok, now a simple test : When, instead of requesting http://yourserversip/SEDO if you request in your browser http://yourserversip/SEDO/index.jsp then your relative image links are working, right ? (provided the images are really there) 20

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Bocalinda
Yes, that would be /SEDO/index.jsp 2008/11/17 André Warnier <[EMAIL PROTECTED]> > Bocalinda wrote: > >> Hi André. >> I'm glad we managed to understand eachother :) >> >> >> Sorry, maybe I did not use the correct example before, but that is wrong. >>> If you original request is >>> http://172,18.

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread André Warnier
Bocalinda wrote: Hi André. I'm glad we managed to understand eachother :) Sorry, maybe I did not use the correct example before, but that is wrong. If you original request is http://172,18.0.1/SEDO and from there, your browser receives an html page (wherever it came from), and that html page c

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Bocalinda
Hi André. I'm glad we managed to understand eachother :) > Sorry, maybe I did not use the correct example before, but that is wrong. > If you original request is > http://172,18.0.1/SEDO > and from there, your browser receives an html page (wherever it came from), > and that html page contains a

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread André Warnier
Bocalinda wrote: Hi André. Applying what you explained above, this would mean that my images paths will be resolved as: http://172.18.0.1/SEDO/image.gif Which of course will not work. Why "of course" ? I may be thick, but I must admit I do not really understand your problem. Sorry for the

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Bocalinda
Hi André. >> Applying what you explained above, this would mean that my images paths >> will >> be resolved as: >> http://172.18.0.1/SEDO/image.gif >> >> Which of course will not work. >> > Why "of course" ? > I may be thick, but I must admit I do not really understand your problem. > Sorry for t

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread André Warnier
Bocalinda wrote: Maybe just a note before you go make all kinds of changes. With an tag like above, it is not so that the server will look in the DocumentRoot. You have to look at it the other way around. The browser, when it sees this tag in the current page, is going to "compose" a URL to re

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Bocalinda
Maybe just a note before you go make all kinds of changes. > With an tag like above, it is not so that the server will look in the > DocumentRoot. > You have to look at it the other way around. > The browser, when it sees this tag in the current page, is going to > "compose" a URL to retrieve it,

Re: [EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread André Warnier
Bocalinda wrote: This works perfectly as I expected. However, the problem I have is that some images or links on my webapp are specified relatively. For example , which results in errors because the image cannot be found on the root of my server, which is logical. Maybe just a note before you g

[EMAIL PROTECTED] Rewrite relative image paths in a reversed proxy setup

2008-11-17 Thread Bocalinda
Hi all. I have an Apache server that takes care of load balancing four Tomcat servers, using mod_proxy. The four Tomcat servers are setup in two clusters: cluster1: 2 Tomcats 5.5.7 cluster2: 2 Tomcats 5.5.27 Now, I have depending on the application that is being requested, the request should be