Load Balancer IP in remote_addr.

Discussion in 'Install/Configuration' started by Matthew_K, Apr 1, 2008.

  1. Matthew_K

    Matthew_K New Member

    Hi, I'm having an issue with getting the client IP because the load balancer is forwarding its own IP.

    I have a LiteSpeed LB and 2 Litespeed WS.

    What is the correct way to get the IP from the client? Is there a transparent way, or does the load balancer have to forward it some how?


    Thanks,

    Matt.
  2. Matthew_K

    Matthew_K New Member

    I think I got it as "HTTP_X_FORWARDED_FOR" but is that just as accurate?
  3. mistwang

    mistwang LiteSpeed Staff

  4. mistwang

    mistwang LiteSpeed Staff

    Its value is the remote IP : port that LB saw. If "X-Forwarded-For" exist in the request that LB receives, LB will append remote IP to it. You can use the last address listed if you want.

    If you set the option in my previous post, LSWS will set "REMOTE_ADDR" to the first IP listed in "X-Forwarded-For" header.
  5. Matthew_K

    Matthew_K New Member

    Great. Thanks. I'm going to use that option. It will save me lots of time.

    Also, will the user agent info still be fowarded?
  6. mistwang

    mistwang LiteSpeed Staff

    yes, it is.
  7. Matthew_K

    Matthew_K New Member

    Fantastic... I've got to say, you guys are great. You're very responsive. I'll be letting my network buddies know.

    Thanks,
    Matt.

Share This Page