Jim,

Most load balancers will set a HTTP header called "X-Forwarded-For"
with the actual IP. We just created a request variable and used it in
our apps. Here is the code we use just in case X-Forwarded-For doesn't
exist.


<!--- Make sure that we know the users real ip address --->
<cftry>
<cfif StructKeyExists(GetHttpRequestData().headers, "X-Forwarded-For")>
        <cfset request.remote_addr = 
GetHttpRequestData().headers["X-Forwarded-For"]>
<cfelse>
        <cfset request.remote_addr = CGI.REMOTE_ADDR>
</cfif>
<cfcatch type="any"></cfcatch>
</cftry>



J.J.


On 12/10/07, James Blaha <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Does anyone operate a CF server behind a load balancer here?
>
> If so, when a user access's a CFM template does the IP of the person come 
> through properly as a CGI variable?
>
> We are using a Citrix NetScaler and the CGI variable that always returns for 
> a IP is that of the load balancer. We can weak the header file but that 
> doesn't change the CGI variable for IP address coming back to ColdFusion.
>
> Regards,
> -Jim
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294485
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to