Welcome Guest, Not a member yet? Register   Sign In
Caching and IP issues. (can I reconfigure $this->input->ip_address() in config.php?)
#1

[eluser]jim-_-[/eluser]
I cache via Varnish and therefore use

$_SERVER['HTTP_X_FORWARDED_FOR']
to get actual IPs instead of
$_SERVER['REMOTE_ADDR'] ( this will only give 127.0.0.1 )


When either of these are used I get the same 127.0.0.1 IP
$this->CI->input->ip_address()
$this->input->ip_address()


Is there something I can add to the Config file of my application that will make Codeigniter use $_SERVER['HTTP_X_FORWARDED_FOR'] instead, so I don't have to rewrite all the libraries i use ?


Edit: Is this something I can do in the Apache or PHP configs ?




Theme © iAndrew 2016 - Forum software by © MyBB