tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Tonhofer <>
Subject Tomcat and "virtual host" routing behind a Proxy
Date Wed, 02 Apr 2008 17:31:29 GMT
Hi there,

A question about Tomcat "virtual host" routing behind a reverse proxy.
I have worked on this for a couple of hours and looks as if Tomcat does 
the unexpected (sale bĂȘte!)

Here's the idea:

I am (reverse) proxing requests from Apache to a Tomcat instance running 
on localhost.
I also have several virtual hosts on the same machine and I want to have 
Tomcat reflect this virtual host setup
(i.e. a separate appBase for each virtual host)

Proxing is done using HTTP, instead of AJP, with request for

"" directed to ""


"" directed to ""

I though that if I did this on the Tomcat side:

  <Service name="standalone_service">
        <Connector port="9330" address="" 
proxyName="" proxyPort="80" />
        <Connector port="9331" address="" 
proxyName="" proxyPort="80" />
        <Engine name="standalone_engine" defaultHost="default_host">
            <Host name="default_host">
                   ... </Host>
            <Host name="">
                   ... </Host>
            <Host name="">
                   ... </Host>

.....then requests for "", caught by the HTTP connector on 
port 9330, would be routed to the "host" named by
proxyName="". Similarly requests for "", 
caught by the HTTP connector on port 9331, would
be routed to the "host" named by proxyName="".

Well, actually no. The request go to go to "default_host" in all cases.

So... does the "proxyName" attribute have no influence on routing by 
hostname? Is this expected behaviour? Can anyone confirm/disconfirm this?

As a workaround I could create several "Services", each with its own 
"Connector" on a separate port, but still...

Best regards,

-- David

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message