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
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to