Hi,
I'm using urlrewrite 2.6 on tomcat 6.0.18. I'm attempting to use it to
set a custom HTTP response header. The header is desgined to tell me
which tomcat server my webapp request has been processed by, as
normally i can't tell from the headers (i use apache->mod_jk->tomcat).
I can set the header to a static value in the webapp's WEB-INF, as in:
<urlrewrite>
<rule>
<from>.*</from>
<set type="response-header" name="X-appserver">my-app-server-name</
set>
</rule>
</urlrewrite>
But that means i need a seperate urlrewrite.xml for each tomcat
server, since "my-app-server-name" will be different base on the
server, and therefore i need a seperate .war for each server, and i'd
like to avoid that.
Is there a way to use a variable or get urlrewrite to insert the
hostname or output from a command?
Such as:
<urlrewrite>
<rule>
<from>.*</from>
<set type="response-header" name="X-appserver">${myjvmroute}</set>
</rule>
</urlrewrite>
where ${myjvmroute} is set for tomcat via -Dmyjvmroute=my-app-server-
name on the tomcat startup line?
Or even to put the urlrewrite rules in the tomcat global configs
instead of in the webapp config?
Thanx, and thanx for writing this software.
-Tony