tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: Handling wildcard domains in Tomcat 8.0
Date Sun, 05 Mar 2017 17:50:29 GMT
On 04/03/17 04:33, Nick Johnson wrote:
> Greetings,
> I have observed that with the default configuration where the <Host> name
> is 'localhost', Tomcat will change the Host and X-Forwarded-Host headers to
> the IP address of the local machine.

That is not correct. Tomcat makes no changes to the Host or
X-Forwarded-Host header it receives in the default configuration.

>  For my use case, this is highly
> undesirable behavior, because the hostname is meaningful to my application
> (but one application needs to handle all possible hosts).
> I've used the <Alias> entry to convince it not to change the Host headers
> for one FQDN; however, I see that wildcard support in <Alias> doesn't exist
> prior to Tomcat 8.5.  As I'm using a hosted service which provides Tomcat
> 8.0, I'm trying to find a workaround for this problem in Tomcat 8 if I can.

The contents of the <Alias /> element has no impact on the contents of
the HTTP Host header.

> Is there any way to have Tomcat 8.0 have a single virtual host handle all
> of a wildcard domain, or, barring that, is there a way to get it to pass
> through the Host header, unchanged, to the default Host (effectively
> directing ALL traffic at the default Host, unchanged, regardless).

Use the default configuration.

Note: If you use a reverse proxy and/or a distribution of Tomcat from
somewhere other than the ASF (e.g. your favourite Linux distribution)
then all bets are off and you'll need to refer to their documentation so
see what the default behaviour is.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message