Show
Ignore:
Timestamp:
18/01/10 14:30:47 (8 weeks ago)
Author:
phk
Message:

Produce the X-Forwarded-For: header in vcl_recv, so people can tweak
as they want.

Append to already existing header if possible.

NB: If you return early from your own vcl_recv, without pasting these
lines in top of your vcl_recv, your backend gets no X-F-F header.

Fixes #601
Fixes #540

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/varnish-cache/bin/varnishd/default.vcl

    r4100 r4467  
    4141 
    4242sub vcl_recv { 
     43    if (req.http.x-forwarded-for) { 
     44        set req.http.X-Forwarded-For = 
     45            req.http.X-Forwarded-For ", " client.ip; 
     46    } else { 
     47        set req.http.X-Forwarded-For = client.ip; 
     48    } 
    4349    if (req.request != "GET" && 
    4450      req.request != "HEAD" &&