readme changelog updated, stable tag updated 1.4.3
[varnish-caching-wordpress-plugin.git] / varnish-conf / v4 / lib / xforward.vcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# xforward.vcl -- X-Forwarded-For HTTP Headers

# This should generally be loaded first to make sure that the headers
# get set appropriately for all requests.  Note that when using this
# you MUST NOT fall through to the VCL default handler for vcl_recv
# since that will run the code again, resulting in the client.ip
# being added twice.

sub vcl_recv {
    if (req.http.X-Forwarded-For) {
        set req.http.X-Forwarded-For =
            req.http.X-Forwarded-For + ", " + client.ip;
    } else {
        set req.http.X-Forwarded-For = client.ip;
    }
}

comments