i am using nginx <=> varnish <=> apache
i am passing client IP to varnish via nginx proxy_set_header X-Forwarded-For $remote_addr;
but varnish also adding X-Forwarded-For as 127.0.0.1 so apache showing 2 IPs comma based.
i need IP send by nginx only i want to disable varnish adding 127.0.0.1
varnish version 3.0.0
here is default.vcl
backend default {
.host = "204.29.58.4";
.port = "80"; } sub vcl_recv {
if (req.http.Range) {
return(pipe);
} }
Best Answer
The default
vcl_recv
function (which is appended to yours) contains this:..which is modifying the header. To prevent this from happening, you should have your
vcl_recv
implemented as a full function that always returns, instead of depending on the appending of the default behavior, which contains config that you don't want. Something like this: