Author Topic: Varnish return 127.0.0.1 or server IP  (Read 13293 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Varnish return 127.0.0.1 or server IP
« on: April 18, 2015, 02:20:39 PM »
Hello,

I have problem, PHP $_SERVER['REMOTE ADDR'] always return 127.0.0.1 or server IP.
How can I fix that? I need client IP address...

Thank

Offline
*
Re: Varnish return 127.0.0.1 or server IP
« Reply #1 on: April 18, 2015, 10:56:54 PM »
I fixed this..

Code: [Select]
sub vcl_recv {
  remove req.http.X-Forwarded-For;
  set    req.http.X-Forwarded-For = client.ip;
}

Offline
*
Re: Varnish return 127.0.0.1 or server IP
« Reply #2 on: May 08, 2017, 11:38:44 PM »
where to place this ?