tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Rifel <>
Subject Access Log Entries with VHost Rewriting
Date Mon, 07 Jul 2014 18:05:37 GMT

I'm implementing some virtual-host rewriting in tomcat 8's rewrite valve and am wondering
if I can somehow set the order that valves are processed for a host.  I have a default host
and want all requests that have a HTTP_HOST of * to be redirected to a second
host.  I have the host rewriting working but the access log entry appears in the default host's
log rather than the second host.  Is there a way to either have the access log valves get
processed after the rewrite valve, or some other setting to have the entry appear in the correct
log?  I tried changing the order of the valves in server.xml but it didn't have any effect.

For what its worth, the reason I'm not using aliases on the second host is because the list
is dynamic (we use developers' names in their dev environment's subdomains, so I'd like a
catch all for their non-default hosts rather than maintaining an ever-growing list of aliases.)

Example: goes to the default host of gets rewritten to our second host of that accepts *
through the default host's rewrite valve. now shows up in the access log rather than the
access log.

Here is my rewrite.config:

RewriteCond %{HTTP_HOST} .*cdn\.domain\.com
RewriteRule /(.*)$1 [host]

Does anyone know if this is possible?

Thank you!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message