Please do not top-post.
Answer below the respective question or comment, not on top of the message.
We don't like to have to scroll up and down to see which answer related to what.

Reka Thirunavukkarasu wrote:
Hi,

I'm using tomcat 7.0.27 and java 1.6 in ubuntu 11.10.

Here I'm not using Apache httpd instead the load balancer that we have
developed which will balance load within tomcat instances.

Obviously, the issue is with our load balancer since it is rewriting
the url to one of the actual running tomcat instance though the
request is to virtual host. Since we plan to use our load balancer, we
plan to send additional http header with virtual host information to
tomcat.

Don't /plan/ to do it, /do it/. You /must/ send a "Host:" header to Tomcat, to allow it to pick the correct VirtualHost. Otherwise how would it do it ?
That's the HTTP/1.1 protocol, nothing special with Tomcat.

 In this case, how could i handle it in tomcat level?

Tomcat will handle it fine, if you send a correct request.
A HTTP 1.1 request without a Host: header is incorrect.


I have defined the virtual hosts in Server.xml. And i have deployed
web applications inside the virtual host as well. When i was trying to
invoke those web application through virtual host from load balancer
only, i got the above problem.


Tomcat is doing what it should do : no "Host:" header in the request, with a value matching a (Virtual) Host name ? --> handle with the default Host.



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

Reply via email to