LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   reverse proxy & tomcat (https://www.linuxquestions.org/questions/linux-server-73/reverse-proxy-and-tomcat-836905/)

goldwing 10-08-2010 04:03 AM

reverse proxy & tomcat
 
Hi,

We use a reverse proxy to forward a lot of websites via 1 central place.
so http://blahblahblah/smt should forward to an internal server.
I already managed to forward a lot of website correctly, except for this one:

when I type: http://blablahblah/smt/webtier-7-11 it doesn't work correctly, but http://blablahblah/webtier-7-11 does !
How can I make the first url to work ?

ProxyPass /smt http://192.168.10.38:8080
ProxyPassReverse /smt http://192.168.10.38:8080
ProxyPassMatch ^/((smt|webtier-7.11)(/.*)?)?$ http://192.168.10.38:8080/$1

ProxyPass /webtier-7.11 http://192.168.10.38:8080
ProxyPassReverse /webtier-7.11 http://192.168.10.38:8080

ProxyPassReverseCookieDomain 192.168.10.38 172.16.20.143


& proxy_ajp.conf:

ProxyPass /smt/ ajp://192.168.10.38:8009/

bathory 10-08-2010 05:53 AM

Hi,

I guess you can use mod_rewrite to rewrite internally /smt/webtier-7-11 to /webtier-7-11
Code:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/smt/webtier-7-11
RewriteRule ^smt/webtier-7-11 /webtier-7-11

ProxyPass /smt http://192.168.10.38:8080
ProxyPassReverse /smt http://192.168.10.38:8080
ProxyPassMatch ^/((smt|webtier-7.11)(/.*)?)?$ http://192.168.10.38:8080/$1

ProxyPass /webtier-7.11 http://192.168.10.38:8080
ProxyPassReverse /webtier-7.11 http://192.168.10.38:8080

ProxyPassReverseCookieDomain 192.168.10.38 172.16.20.143


goldwing 10-08-2010 06:48 AM

Thanks, just tried that, but now the application is not loading decently (cleared all cache, etc. first)
Think it has to do with tomcat, but can't find the clue.

bathory 10-08-2010 07:22 AM

What you mean by "not loading decently"?
Are you using the default:
Code:

ProxyPreserveHost On
ProxyRequests Off

Also I don't think you need the "ProxyPassMatch" and "ProxyPassReverseCookieDomain" any more

goldwing 10-08-2010 09:45 AM

We used the 'JkMount' options to handle our tomcat requests.

How do I do these redicrections now with the 'Rewrite':

/smt --> /webtier-7.11/index.do
/smt-ess --> /webtier-7.11/ess.do
/smt-calendar --> /calendar

bathory 10-08-2010 03:15 PM

You can use:
Code:

RewriteEngine on

RewriteRule ^smt$ /webtier-7.11/index.do
RewriteRule ^smt-ess$ /webtier-7.11/ess.do
RewriteRule ^smt-calendar$ /calendar

Regards


All times are GMT -5. The time now is 12:23 PM.