Regex question

Hugo Cisneiros (Eitch) hugo.cisneiros at gmail.com
Tue Aug 7 22:45:27 CEST 2012


On Mon, Aug 6, 2012 at 9:13 PM, Jonathan Hursey
<jonathan.hursey at adrevolution.com> wrote:
> if (req.http.host == ('^(cdn)\..+\.+')
>   {
>       set req.backened = cdnserver
>   }

Use the "~" symbol when using regex while comparing[1].

This should work:

if (req.http.host ~ "^cdn\.") {
  set req.backend = be_cdnserver;
}

[1] https://www.varnish-cache.org/docs/3.0/reference/vcl.html

-- 
[]'s
Hugo
www.devin.com.br



More information about the varnish-misc mailing list