Thanx for that, that sets the header for me, but to something static.
Only problem I have is I can't seem to figure out how to set it to the hostname
of the tomcat server, or a tomcat variable (set from the hostname of the server
- i.e. -Dmyjvmroute=`/bin/hostname -s` and then trying to use ${myjvmroute} in
a rule such as:
<urlrewrite>
<rule>
<from>.*</from>
<set type="response-header" name="X-appserver">${myjvmroute}</set>
</rule>
</urlrewrite>
Unofrtunately, I really don't have anything in the http request headers to base
a condition off of to say what tomcat server I'm on.
-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
[email protected]
http://www.formatdynamics.com
> -----Original Message-----
> From: André Warnier [mailto:[email protected]]
> Sent: Friday, June 05, 2009 10:00 AM
> To: Tomcat Users List
> Subject: Re: custom header
>
> Anthony J. Biacco wrote:
> > Is there a way to set a custom HTTP header from tomcat/mod_jk for the
> > AJP connector? Short of changing the tomcat/mod_jk source code, that
> is.
> > I have requests go from apache -> mod_jk -> tomcat, multiple servers,
> > and I want to see in a Response header what tomcat my request is
> getting
> > processed by.
> >
> I am not sure that this is the quickest/easiest solution, but you
> should
> be able to do that with a servlet filter at the Tomcat level.
> Maybe have a look at the usual toolbox for this kind of thing :
> urlrewritefilter at tuckey.org ?
> It should allow you to add a custom response header without any
> reprogramming.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]