Pivotal Knowledge Base

Follow

Using mod_jk, how to exclude certain files in Tomcat web application context from being passed to Tomcat

[Preliminary] How to exclude certain files in Tomcat web application context from being passed to Tomcat (2014633_draft)

Resolution

Is there a way to exclude certain file types in a Tomcat web application context from being passed to Tomcat?

There is a new JK directive introduced in mod_jk 1.2.7 and higher, JkUnMount.

For example:

JkUnMount /webapp/.gif ajp13
JkUnMount /webapp/.jpg ajp13
JkUnMount /webapp/.bmp ajp13 ...

JkMount /webapp/* ajp13

In this example, JkUnMount takes precedence over JkMount. All .gif, .jpg and .bmp in web application /webapp will be excluded from being passed to Tomcat. The rest of the context will be forwarded to Tomcat.
©VMware 2013

Comments

Powered by Zendesk