Cookie and X-FOrwarded-For

Cedric Tabary tabary at efrei.fr
Fri Oct 13 11:51:34 CEST 2006


On 13/10/2006 10:50, Dag-Erling Smrgrav wrote:
> Cedric Tabary <tabary at efrei.fr> writes:
> > Thanks for your help on caching php, but now I have another problem.
> > When I do a request with a cookie the X-Forwarded-For is not set.
> 
> If you're running 1.0.1, it's a known bug that has been fixed in
> trunk.

Strange because I was running trunk.

/usr/local/varnish/sbin/varnishd -a '0.0.0.0:80' -b'127.0.0.1:8080' -T
127.0.0.1:1664 -sfile,/tmp/varnish,1g -t 0

I added this in PassSession() in cache_pass.c
    http_PrintfHeader(w, vc->fd, vc->http,
            "X-Forwarded-for: %s", sp->addr);

I don't know if it is the right place but it worked for me :)

Cédric




More information about the varnish-misc mailing list