Skip to content

Commit

Permalink
X-Forwarded-For is now in V4 default
Browse files Browse the repository at this point in the history
This causes duplication of the header currently and is best removed.
  • Loading branch information
LukeHandle committed Sep 14, 2015
1 parent e4bb049 commit 9c730cb
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions default.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ sub vcl_recv {

set req.backend_hint = vdir.backend(); # send all traffic to the vdir director

if (req.restarts == 0) {
if (req.http.X-Forwarded-For) { # set or append the client.ip to X-Forwarded-For header
set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;
} else {
set req.http.X-Forwarded-For = client.ip;
}
}

# Normalize the header, remove the port (in case you're testing this on various TCP ports)
set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");

Expand Down

0 comments on commit 9c730cb

Please sign in to comment.