excluding some path from tomcat
Hi, I use Apache web server 2.2 in front of tomcat, it works well with Apache's default proxy module, however, I can't exclude some path from it: ProxyPass / http://localhost:8080/ ProxyPass /static ! ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on example.com/static still goes to my tomcat app, any idea? thanks, Angelo -- View this message in context: http://old.nabble.com/excluding-some-path-from-tomcat-tp29418981p29418981.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
excluding some path from tomcat
Hi, I use Apache web server 2.2 in front of tomcat, it works well with Apache's default proxy module, however, I can't exclude some path from it: ProxyPass / http://localhost:8080/ ProxyPass /static ! ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on example.com/static still goes to my tomcat app, any idea? thanks, Angelo -- View this message in context: http://old.nabble.com/excluding-some-path-from-tomcat-tp29418980p29418980.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: excluding some path from tomcat
Angelo Chen wrote: Hi, I use Apache web server 2.2 in front of tomcat, it works well with Apache's default proxy module, however, I can't exclude some path from it: ProxyPass / http://localhost:8080/ ProxyPass /static ! ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on example.com/static still goes to my tomcat app, any idea? No, but this looks like a question for the Apache httpd users list, not this Tomcat one. Your poor Tomcat has no influence on the matter. By the way, considering your above apparent intention, it is not clear that you need an Apache front-end. Tomcat can server static content directly, just as fast. Try this : - stop Apache and Tomcat - copy the content of the Apache /static directory under (tomcat)/webapps/static/ - change the HTTP port of Tomcat from 8080 to 80 (in server.xml) - start Tomcat and try it out. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: excluding some path from tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Angelo, On 8/12/2010 9:59 AM, Angelo Chen wrote: I use Apache web server 2.2 in front of tomcat, it works well with Apache's default proxy module, however, I can't exclude some path from it: ProxyPass / http://localhost:8080/ ProxyPass /static ! ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on This is one of the reasons I have decided to stick with mod_jk instead of mod_proxy_http or mod_proxy_ajp: I couldn't figure out how to map different sub-URIs to different places. What happens if you do this: ProxyPass /static ! ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on (I have only reversed the order of the ProxyPass directives). If mod_proxy processes rules in order until one matches, it may be that ProxyPass / is taking over without ever checking the /static rule you have there. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxkO5cACgkQ9CaO5/Lv0PBHyACeMnvFJaGcSTYcniQ+IBiRspu+ v9IAn3/33WitRR0WohzdTA1cg51aMTcr =N2po -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: excluding some path from tomcat
On 12.08.2010 15:59, Angelo Chen wrote: Hi, I use Apache web server 2.2 in front of tomcat, it works well with Apache's default proxy module, however, I can't exclude some path from it: ProxyPass / http://localhost:8080/ ProxyPass /static ! ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on example.com/static still goes to my tomcat app, any idea? thanks, Citing Apache docs [1]: Order is important: exclusions must come before the general ProxyPass directive. The directives are checked against the request in the order given. The first match wins. Regards, Rainer [1] http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: excluding some path from tomcat
On 12.08.2010 20:21, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Angelo, On 8/12/2010 9:59 AM, Angelo Chen wrote: I use Apache web server 2.2 in front of tomcat, it works well with Apache's default proxy module, however, I can't exclude some path from it: ProxyPass / http://localhost:8080/ ProxyPass /static ! ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on This is one of the reasons I have decided to stick with mod_jk instead of mod_proxy_http or mod_proxy_ajp: I couldn't figure out how to map different sub-URIs to different places. What happens if you do this: ProxyPass /static ! ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost on (I have only reversed the order of the ProxyPass directives). If mod_proxy processes rules in order until one matches, it may be that ProxyPass / is taking over without ever checking the /static rule you have there. Bonus point! Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org