Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old July 19th, 2005, 07:27 AM
Peter Hurford
Guest
 
Posts: n/a
Default Host Name / IP behind a load balancer

Hi,

Have just noticed some code not working properly. I have a couple of
identical web servers set up, and a load balancer out front.

I execute the line of code....

Response.Write Request.ServerVariables("SERVER_NAME") & " (" &
Request.ServerVariables("LOCAL_ADDR") & ")"


Problem is, in this environment, it's giving me the name and the ip
address of the load balancer, not the server.

The reason I'm doing this (obviously) is I want to be able to know which
of the servers is serving the page.

The code, registry etc. on each server are identical, and must remain
so. The only differences (of course) are things like their host names,
ip addresses etc.

I'm sure I've seen this done but can't remember how, and can't find
anything on the msdn. Anyone out there know?

TIA

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #2  
Old July 19th, 2005, 07:28 AM
Aaron Bertrand - MVP
Guest
 
Posts: n/a
Default Re: Host Name / IP behind a load balancer

See the WMI script here
http://www.aspfaq.com/2263



"Peter Hurford" <peter.hurford@microcrest.com> wrote in message
news:#rf8G1NXDHA.736@TK2MSFTNGP09.phx.gbl...[color=blue]
> Hi,
>
> Have just noticed some code not working properly. I have a couple of
> identical web servers set up, and a load balancer out front.
>
> I execute the line of code....
>
> Response.Write Request.ServerVariables("SERVER_NAME") & " (" &
> Request.ServerVariables("LOCAL_ADDR") & ")"
>
>
> Problem is, in this environment, it's giving me the name and the ip
> address of the load balancer, not the server.
>
> The reason I'm doing this (obviously) is I want to be able to know which
> of the servers is serving the page.
>
> The code, registry etc. on each server are identical, and must remain
> so. The only differences (of course) are things like their host names,
> ip addresses etc.
>
> I'm sure I've seen this done but can't remember how, and can't find
> anything on the msdn. Anyone out there know?
>
> TIA
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.