NLB, IIS 6.0, .NET ASP Web App Randomly Changing URL From Hostname

G

Guest

I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup with NLB (single
Affinity, also using SQLServer session state) that are hosting a few .NET ASP
web applications under the Default Website in IIS, and accessing via a
Intranet LAN (this is not publicly available).

NETWEB1:
NIC1 172.16.17.220
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.221


NETWEB2:
NIC1 172.16.17.222
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.223


I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix


The problem is... (referring to a session running on NETWEB1)...

Using Virtual Hostname FQDN (http://nlb.domain.com): Randomly, the a link
will change from the NLB Virtual Hostname to the NLB Virtual IP address, and
clicking on the link will start a new session, requiring re-login (the URL is
now http://172.16.17.244).

Using Virtual Hostname (http://nlb): Randomly, the a link will change from
the NLB Virtual Hostname to the Non-NLB Server IP address, and clicking on
the link will start a new session, requiring re-login (the URL becomes
http://172.16.17.221).


This seems to be completely random in timing, but does happen after a few
minutes of navigating around the website.

Any Ideas??? :(
 
N

Nick Malik [Microsoft]

Hello James,
I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix

Why?

If your links are relative links, you never need to do this.

..Net is fully capable of being hosted under load balancing without your help
in assigning the URL directly to the host. In fact, the behavior that you
are seeing is probably normal, in that a load balancer using single affinity
will, on its own accord and outside of your control, act as a proxy,
reissuing the request from the proxy FQDN to the actual server. Your
statement above captures the name used by the load balancer and reinserts it
in front of the current page name.

It's as though you WANT to circumvent the load balancer... and I can't
understand why you would want to do that.

Simply make all of your URLs relative, or absolute using the NLB's FQDN and
this issue goes away.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 
G

Guest

Thank you Nick!
I have relayed the information to the programming team to implement and
test. That seems to be the only issue we have had so far with NLB.


Take Care,
James M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top