Oh interesting. I think I may have had a slight formatting issue. I've tried copying the code into my VCL again and it ran fine. Sorry for the false alarm. Hope I didn't waste anyone's time.
Thanks Tim On Wed, May 7, 2014 at 2:52 AM, Per Buer <[email protected]> wrote: > Hi Tim. > > > On Wed, May 7, 2014 at 4:27 AM, Tim Dunphy <[email protected]> wrote: > >> Hey All, >> >> I'm trying to write a VCL subroutine. The purpose of the section I am >> having a problem with is to set some headers when it encounters a restart >> condition. Here's the code. >> >> 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; } >> } >> >> if (req.request != "GET"&&req.request != "HEAD") { >> return (pass); >> } >> >> set req.backend = www; >> } >> > > FWIW, I took the above code, put it in a file, along with a backend named > www and the code compiled and loaded just fine. > > > -- > <http://www.varnish-software.com/> *Per Buer* > CTO | Varnish Software > Phone: +47 958 39 117 | Skype: per.buer > We Make Websites Fly! > > Winner of the Red Herring Top 100 Global Award 2013 > > > -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
