[Solved] Request header not accessible from $_SERVER

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

  1. roycerus

    roycerus New Member

    Hello,
    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?

    Regards,
    Roy
  2. webizen

    webizen New Member

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

    roycerus New 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 New Member

    thanks for the update.

Share This Page