From 3c12da859e47c205d5e6cabbc74c8de53fb45a8d Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Wed, 5 Apr 2017 23:57:30 +0000 Subject: [PATCH] Normalize the X-Forwarded-For header Signed-off-by: Patrick Uiterwijk --- roles/varnish/templates/kojipkgs.vcl.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/varnish/templates/kojipkgs.vcl.j2 b/roles/varnish/templates/kojipkgs.vcl.j2 index 350cc23cc7..af68e0cbae 100644 --- a/roles/varnish/templates/kojipkgs.vcl.j2 +++ b/roles/varnish/templates/kojipkgs.vcl.j2 @@ -32,6 +32,9 @@ backend localapache { } sub vcl_recv { + # This gets arround the silly, ::1 that Apache adds on the proxies (still need to look at that) + set req.http.X-Forwarded-For = regsub(req.http.X-Forwarded-For, "^([a-f0-9:.]+), .+$", "\1"); + set req.backend_hint = localapache; unset req.http.cookie; set req.http.clear-cookies = "yes";