473,467 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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??? :(
--------------------------------
From: James M
Jul 21 '05 #1
2 5584
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.
--
"James M." <Ja****@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...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??? :(
--------------------------------
From: James M

Jul 21 '05 #2
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.

"Nick Malik [Microsoft]" wrote:
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.
--
"James M." <Ja****@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
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??? :(
--------------------------------
From: James M


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lukas Schnieper | last post by:
Hi How can i get the hostname of my Linux PC? I tried os.system('hostname') but i cant save the hostname in a variable like hostname = os.system('hostname') thanks Lukas Schnieper
2
by: Walti | last post by:
Hi I stumbled over a strange problem in A2K concerning the Tab Order of 60 textboxes placed on a tab control: whenever I change the TabIndex of any one of these textboxes the other 59 change...
1
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True...
0
by: James M via .NET 247 | last post by:
(I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup withNLB (single Affinity, also using SQLServer session state) thatare hosting a few .NET ASP web applications under the DefaultWebsite in...
2
by: James M. | last post by:
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...
3
by: Mark Delaney | last post by:
When using the MS SQL 2005 JDBC driver, I now need to have the DNS name resolution to the client correctly set up. If not I get the following error: SQLState: 08S01 SQLError: 0 Message:...
1
by: PaulReddin | last post by:
Hi, We have several instances & Databases on an AIX5.3 Server. We need to change the hostname of the Server, will this break DB2? The only reference to hostname I can "see" is in the Global...
10
by: 7stud | last post by:
Hi, I'm experimenting with a basic socket program(from a book), and both the client and server programs are on my computer. In both programs, I call socket.gethostname(), but I discovered that...
1
by: ksuralta | last post by:
Hi everyone, Hope somebody can help me with this. I have a framed window. -------------------------------- Frame 1 -------------------------------- | 2 | Frame 3
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.