David,

I'm a little confused. As I understand it, the default Varnish vcl_recv
behaviour will be appended to my custom rules. In Varnish 3, this includes:

# sub vcl_recv {
#     if (req.restarts == 0) {
#       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;
#       }
#     }

which seems to be pretty much the same as you've posted. Can I assume that
this already being parsed (as my custom vcl_recv isn't terminated), and not
doing what I need?

<snip>

choose your own adventure.

in vcl_recv:

         if (req.http.x-forwarded-for) {
             # remove req.http.X-Forwarded-For;
             # set req.http.X-Forwarded-For = client.ip;
             #retain x-forwarded-for data and append
             set req.http.X-Forwarded-For = req.http.X-Forwarded-For ","
client.ip;
         } else {
             set req.http.X-Forwarded-For = client.ip;
         }


(noting that I use 2.1...)

--
david raistrick        http://www.netmeister.org/news/learn2quote.html
[email protected]       ascii ribbon campaign - stop html mail
                                 http://www.asciiribbon.org/




_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to