forwarding original IP address

Davies Matt J A (LCSS) mjdavies at glam.ac.uk
Mon Jul 19 19:04:43 CEST 2010


Hi Paul, everyone.

My bad, I tried your version, was getting the same IP in the logs.  

Then checked what I was actually telling nginx to output at that point, and I wasn't showing the $http_x_forwarded_for value at all :-).  Now I am, I can see that it's showing me the right IP.

Thanks again.

You live, you learn

Matt






On 19 Jul 2010, at 17:54, Paul A. Procacci wrote:

> I have the following which works for me!
> 
>        remove req.http.X-Forwarded-For;
>        set req.http.X-Forwarded-For = client.ip;
> 
> ~Paul
> 
> On Mon, Jul 19, 2010 at 12:46:14PM -0400, Davies Matt J A (LCSS) wrote:
>> Hi everyone
>> 
>> This is probably very easy but I thought I'd check I've got this right first.
>> 
>> On my web server, I want to display the original IP address of the client, not the IP of the varnish server, in the error logs from the web server.
>> 
>> I've done some reading and found this example in the docs
>> 
>> sub vcl_recv {
>> 
>> # Add a unique header containing the client address
>> 
>>      remove req.http.X-Forwarded-For;
>>      set    req.http.X-Forwarded-For = req.http.rlnclientipaddr;
>> 
>> Is that all I need to do?
>> 
>> Any help, greatly appreciated.
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc at varnish-cache.org
>> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
> 
> This message may contain confidential or privileged information.  If you are not the intended recipient, please advise us immediately and delete this message.  See http://www.datapipe.com/about-us-legal-email-disclaimer.htm for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.





More information about the varnish-misc mailing list