You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2010/08/12 15:59:12 UTC
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: excluding some path from tomcat
Posted by André Warnier <aw...@ice-sa.com>.
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: excluding some path from tomcat
Posted by Rainer Jung <ra...@kippdata.de>.
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: excluding some path from tomcat
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org