X-Forwarded-Forand 2 layers of Varnish

Kristian Lyngstol kristian at redpill-linpro.com
Fri Jan 22 15:08:46 CET 2010

(A bit of necroposting, hopefully still relevant)

On Tue, Dec 01, 2009 at 03:26:35PM -0500, Jean-Christophe Petit wrote:
> we use 2 layers of Varnish and it proved to be highly scalable and 
> efficient.
> But on the second layer, we are not able to get the X-Forwarded-For from 
> the first layer to sent it to the Backend (Apache)
> In fact, on the second layer we have 2 X-Forwarded-For (Visitor + first 
> Varnish layer)
> Is there something we can do on the first Varnish layer to only transmit 
> the X-Forwarded-For of the visitor ?

This is "fixed" in trunk, in that X-F-F is moved into the default VCL and
appends correctly.

In Varnish 2.0 you could work around it by having the first set
X-Original-Forwarded-For, then on the second tier, you overwrite
X-Forwarded-For with X-Original_forwarded-For... It's not horribly pretty,
but should get you what you want until the trunk-fixes are in a release.

Kristian Lyngstøl
Redpill Linpro AS
Mob: +47 99014497
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100122/885d429a/attachment-0003.pgp>

More information about the varnish-misc mailing list