[Solved] Request header not accessible from $_SERVER

Discussion in 'Install/Configuration' started by roycerus, May 11, 2012.

  1. roycerus

    roycerus Member

    We are using akamai cache which forwards us the real client ip in a custom header called True-Client-IP - We can see the header in the request header but when we use the $_SERVER['True-Client-IP'] it doesn't return the value:

    Below is a sample request header

    We are now using this code to extract and use the extra header

    Is there any way to make litespeed recognize this extra header and make it available in the $_SERVER global variable. We are not even sure if this is a litespeed or a lsphp5 issue.

    Can someone from the litespeed staff please shed some light about why this is happening?

  2. webizen

    webizen Well-Known Member

    can you use X-Forwarded-For? that's standard header that lsws supports.
  3. roycerus

    roycerus Member

    Yeah... that was returning a set of IPs - including multiple proxies.

    The way this got solved was by using $_SERVER["HTTP_TRUE_CLIENT_IP"]

    That seems to return the correct ip address.
  4. webizen

    webizen Well-Known Member

    thanks for the update.

Share This Page