Question about variables

Guillaume Quintard guillaume at varnish-software.com
Wed Jun 29 18:14:52 CEST 2016


Hi,

What do you mean by "work"? What's the expected result, and what is the
actual result?

-- 
Guillaume Quintard

On Wed, Jun 29, 2016 at 8:17 AM, Andrei <lagged at gmail.com> wrote:

> Hello,
>
> I'm currently working on forcing cached results using vsthrottle vs
> dropping requests, but for some reason (I probably did it wrong :) I can't
> get var.get/var.set_duration to work. The vcl_recv snippet is as follows,
> any input is greatly appreciated:
>
> sub vcl_recv {
>         if (vsthrottle.is_denied(req.http.Host, 500, 5s) ||
> (var.get("block-" + req.http.Host))) {
>                 # The vsthrottle rate limit definitely triggers -
> confirmed later with "Attack" header
>                 unset req.http.Cookie;
>                 unset req.http.User-Agent;
>                 unset req.http.Pragma;
>                 unset req.http.Cache-Control;
>                 set req.http.Attack = "ByHost: " + req.http.Host;
>                 set req.ttl = 15m;
>                 var.set_duration("block-" + req.http.Host,15m);
>                 return (hash);
>         }
> [..]
> }
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160629/3392b786/attachment.html>


More information about the varnish-misc mailing list