tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Jain <Eric.J...@isb-sib.ch>
Subject Re: Setting up virtual hosts behind a reverse proxy
Date Fri, 02 Dec 2005 12:20:43 GMT
Eric Jain wrote:
> I have a Tomcat (5.5.12) server that is hidden behind Apache. On the 
> Apache server, several virtual hosts are defined.
> 
> <VirtualHost xxx.xxx.xxx.xxx>
>   ServerName xxxxxxxx.xxxxxxx.xx
>   ProxyPass / http://localhost:8080/
>   ProxyPassReverse / http://localhost:8080/
> </VirtualHost>
> 
> Now I'd like to map some of these virtual hosts to virtual hosts on the 
> Tomcat server.
> 
> Unfortunately this doesn't quite work as Tomcat is unaware of the 
> original hostname that was requested (even though this information 
> remains present in a X-Forwarded-Host header value).

The solution turned out to be quite simple:

<VirtualHost xxx.xxx.xxx.xxx>
   ServerName xxxxxxxx.xxxxxxx.xx
   ProxyPass / http://xxxxxxxx.xxxxxxx.xx:8080/
   ProxyPassReverse / http://xxxxxxxx.xxxxxxx.xx:8080/
</VirtualHost>

i.e. forward requests to xxxxxxxx.xxxxxxx.xx:8080 rather than localhost:8080.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message