<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Load Balancing Digest &#187; redirect</title>
	<atom:link href="http://lbdigest.com/tag/redirect/feed/" rel="self" type="application/rss+xml" />
	<link>http://lbdigest.com</link>
	<description>Server Load Balancing Articles and News</description>
	<lastBuildDate>Mon, 22 Aug 2011 12:16:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>There&#8217;s No One Here By That Name</title>
		<link>http://lbdigest.com/2008/04/02/theres-no-one-here-by-that-name/</link>
		<comments>http://lbdigest.com/2008/04/02/theres-no-one-here-by-that-name/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 16:22:20 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Feature Articles]]></category>
		<category><![CDATA[302]]></category>
		<category><![CDATA[app server]]></category>
		<category><![CDATA[http headers]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://lbdigest.com/?p=108</guid>
		<description><![CDATA[Here&#8217;s one of the trickier issues that can sometimes come up with load balancing. You&#8217;ve setup load balancing for a couple of application servers, and at least on a TCP...]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one of the trickier issues that can sometimes come up with load balancing.  You&#8217;ve setup load balancing for a couple of application servers, and at least on a TCP level, things appear to be working.  However, the app guys are complaining that the load balancer is doing something weird, and when you punch up the website, you get the familiar &#8220;page cannot be displayed error&#8221;.</p>
<p style="text-align: center;"><a href="http://lbdigest.com/wp-content/uploads/2008/04/cannotbedisplayed.png"><img class="alignnone size-medium wp-image-109" title="cannotbedisplayed" src="http://lbdigest.com/wp-content/uploads/2008/04/cannotbedisplayed-300x175.png" alt="" width="300" height="175" /></a></p>
<p>It looks entirely like the load balancer&#8217;s problem, but you&#8217;re sure it&#8217;s not.  So what gives?</p>
<p>One reason (especially if they&#8217;re using an app server like IBM WebSphere) is that the server can be giving you a &#8220;there&#8217;s no one here by that name&#8221; re-direct.  Lemme &#8216;splain.</p>
<p>When a browser makes a request, part of the request is the HTTP header &#8220;host:&#8221; field.   Whatever the client puts in the address bar of their browser is populated into the HTTP host header (regardless if name resolution comes from DNS or a static entry in your &#8220;hosts&#8221; file).</p>
<p style="text-align: center;"><a href="http://lbdigest.com/wp-content/uploads/2008/04/addressbar.png"><img class="alignnone size-medium wp-image-111" title="addressbar" src="http://lbdigest.com/wp-content/uploads/2008/04/addressbar-300x98.png" alt="" width="300" height="98" /></a></p>
<p>This host field is relayed, without modification, to the web server.  The load balancer typically doesn&#8217;t look at this, and certainly doesn&#8217;t change it.</p>
<p style="text-align: center;"><a href="http://lbdigest.com/wp-content/uploads/2008/04/hostfield.png"><img class="alignnone size-medium wp-image-113" title="hostfield" src="http://lbdigest.com/wp-content/uploads/2008/04/hostfield-300x94.png" alt="" width="300" height="94" /></a></p>
<p style="text-align: left;">A problem can occur if the web server doesn&#8217;t know it&#8217;s supposed to be serving up the website specified in the &#8220;Host:&#8221; field.  Most web servers are configured to drop to a default document root if it doesn&#8217;t have a specific configuration for the &#8220;Host:&#8221; header.  If there is a default, then an HTTP 200 OK response is given and a page delivered.</p>
<p style="text-align: left;">Some servers, however, will essentially say &#8220;There&#8217;s no one here by that name&#8221;, and do a re-direct to a web site that it is configured for.  This is common with certain types of application servers that run their own web servers, and they&#8217;re configured for their default hostnames (rather than the domain name of the site).</p>
<p style="text-align: left;">For instance, let&#8217;s say you have three web servers.  You give them the hostnames of web1.lbdigest.com, web2.lbdigest.com, and web3.lbdigest.com.  A VIP is configured on the load balancer, and DNS is set to point to that virtual IP.  The website is advertised as lbdigest.com, so the &#8220;Host:&#8221; field is populated with &#8220;lbdigest.com&#8221; when a request is made.</p>
<p style="text-align: left;">The load balancer accepts the connection, and forwards it to web2.lbdigest.com.  The web2.lbdigest.com server sees the &#8220;Host:&#8221; header as &#8220;lbdigest.com&#8221;, and says &#8220;Woah, I have no idea who lbdigest.com.  I only know about web2.lbdigest.com.  I&#8217;m going to redirect you to web2.lbdigest.com&#8221;.  An HTTP 302 response is given, which tells the client browser to go to web2.lbdigest.com.  Unfortunately, there&#8217;s no public DNS for this hostname, so the browser gives the rather informative error &#8220;website cannot be displayed&#8221;.</p>
<p style="text-align: center;"><a href="http://lbdigest.com/wp-content/uploads/2008/04/hostfieldresponse.png"><img class="alignnone size-medium wp-image-115" title="hostfieldresponse" src="http://lbdigest.com/wp-content/uploads/2008/04/hostfieldresponse-300x142.png" alt="" width="300" height="142" /></a></p>
<p style="text-align: left;">If there&#8217;s no public DNS record for web2.lbdigest.com, or if there&#8217;s no public network access directly to the web2 server, you&#8217;ll get &#8220;Website cannot be displayed&#8221; error in Microsoft IE.  Even if you can access the server directly, this bypasses the load balancer and negates it&#8217;s purpose.  If that server goes down, clients aren&#8217;t sent to an available server.</p>
<p style="text-align: left;">Again, most web servers will handle an unknown &#8220;Host:&#8221; header by serving up a default page.  But some web servers, particularly application web servers, won&#8217;t serve up a default page.  Somewhere, deep within their configuration files, there&#8217;s a field for the hostname of the app server instance.  If none is specified, it can default to the system&#8217;s host name (which usually doesn&#8217;t match the domain name it&#8217;s supposed to be serving up).</p>
<p style="text-align: left;"><em><strong>How To Prove This</strong></em></p>
<p style="text-align: left;">The tricky part is proving this to the app server group.  This can be done relatively easily with one of the browser header tools, such as <a href="http://www.blunck.se/iehttpheaders/iehttpheaders.html">IEHTTPHeaders</a> and <a href="http://livehttpheaders.mozdev.org/">Firefox Live HTTP Headers</a>.  Punch up the website, and you&#8217;ll see the 302 come from the server, and you have your proof.</p>
<p style="text-align: left;"><em><strong>Solution</strong></em></p>
<p style="text-align: left;">The fix is pretty easy.  Have the application group configure each of their app/web servers to set their configuration files to specify the domain name that the load balancer answers to.  Once this is done, the application should respond correctly.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2008/04/02/theres-no-one-here-by-that-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

