Combining req.url matches

pub crawler pubcrawler.com at gmail.com
Mon Jan 11 11:33:17 CET 2010


Thanks Nils,

The backslash part I hadn't got before this- makes sense.

I used a poor example of a list of files for combination.  Your
solution got me thinking about our filenaming conventions going
forward though.

Let's try this one - can these somehow be combined into one?

if (req.url ~ "systemstatus\.cfm") {lookup;}
if (req.url ~ "index\.cfm") {lookup;}

-Paul


On Mon, Jan 11, 2010 at 4:59 AM, Nils Goroll <slink at schokola.de> wrote:
> Hi "Pub Crawler",
>
>> For instance:
>> if (req.url ~ "photoupload.cfm") {pass;}
>> if (req.url ~ "logoupload.cfm") {pass;}
>>
>> Is there a prescribed way to combine that into one line?
>
> Firstly, you should note that the argument to the ~ operator is a regexp, so
> if you mean a literal dot, it's \. . You can also group subexpressions like
> this:
>
> if (req.url ~ "(photo|logo)upload\.cfm") {pass;}
>
> Nils
>



More information about the varnish-misc mailing list