Jan 222015
 

Avec Varnish 4 le X-Forwarded-For est ajouté automatiquement avant le vcl_recv :
https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html#x-forwarded-for-is-now-set-before-vcl-recv

Si vous avez un autre cache ou proxy devant le varnish qui ajoute déjà le X-Forwaded-For et voulez enlever l’IP de ce proxy à la liste X-Forwarded-For. Vous pouvez utiliser ceci :

set req.http.X-Forwarded-For = regsub(req.http.X-Forwarded-For,", ([0-9]{1,3}\.){3}([0-9]{1,3})$","");

ou

set req.http.X-Forwarded-For = regsub(req.http.X-Forwarded-For, "^(.*),([^,]+)$", "\1");

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

(required)

(required)

Spam protection by WP Captcha-Free