Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Regex question

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


zeeshan at infoshield

Aug 6, 2012, 4:53 PM

Post #1 of 6 (557 views)
Permalink
Regex question

Hi, sorry it is more related with regex .. any hint ?

I want all domain starting from cdn to use certain backend. no matter what
the tld is for example all :

cdn.xy.asda.com
cdn.sda.com
cdn.cdad.asda.ada.ad.net


what is the suitable regex for above?


thanks in advance
BR


Zeeshan


jonathan.hursey at adrevolution

Aug 6, 2012, 5:13 PM

Post #2 of 6 (537 views)
Permalink
Re: Regex question [In reply to]

if (req.http.host == ('^(cdn)\..+\.+')
{
set req.backened = cdnserver
}


Something like that will work


On Mon, Aug 6, 2012 at 6:53 PM, Zeeshan Ali Shah <zeeshan [at] infoshield>wrote:

> Hi, sorry it is more related with regex .. any hint ?
>
> I want all domain starting from cdn to use certain backend. no matter
> what the tld is for example all :
>
> cdn.xy.asda.com
> cdn.sda.com
> cdn.cdad.asda.ada.ad.net
>
>
> what is the suitable regex for above?
>
>
> thanks in advance
> BR
>
>
> Zeeshan
>
>
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>


hugo.cisneiros at gmail

Aug 7, 2012, 1:45 PM

Post #3 of 6 (530 views)
Permalink
Re: Regex question [In reply to]

On Mon, Aug 6, 2012 at 9:13 PM, Jonathan Hursey
<jonathan.hursey [at] adrevolution> 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

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


jonathan.hursey at adrevolution

Aug 7, 2012, 1:48 PM

Post #4 of 6 (533 views)
Permalink
Re: Regex question [In reply to]

oops... I knew that

On Tue, Aug 7, 2012 at 3:45 PM, Hugo Cisneiros (Eitch) <
hugo.cisneiros [at] gmail> wrote:

> On Mon, Aug 6, 2012 at 9:13 PM, Jonathan Hursey
> <jonathan.hursey [at] adrevolution> 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
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>


zeeshan at infoshield

Aug 12, 2012, 4:52 PM

Post #5 of 6 (519 views)
Permalink
Re: Regex question [In reply to]

Hi, Thanks alot for help ..

what if we want to check specific
1) specific plugin lets say postie in wordpress ?
2) all of url under plugin ?


thanks in advance.

BR

Zeeshan

On Tue, Aug 7, 2012 at 10:48 PM, Jonathan Hursey <
jonathan.hursey [at] adrevolution> wrote:

> oops... I knew that
>
>
> On Tue, Aug 7, 2012 at 3:45 PM, Hugo Cisneiros (Eitch) <
> hugo.cisneiros [at] gmail> wrote:
>
>> On Mon, Aug 6, 2012 at 9:13 PM, Jonathan Hursey
>> <jonathan.hursey [at] adrevolution> 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
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc [at] varnish-cache
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>


zeeshan at infoshield

Aug 14, 2012, 3:56 AM

Post #6 of 6 (512 views)
Permalink
Re: Regex question [In reply to]

Hi, Got good link here http://kly.no/varnish/regex.txt


Zeeshan

On Mon, Aug 13, 2012 at 1:52 AM, Zeeshan Ali Shah
<zeeshan [at] infoshield>wrote:

> Hi, Thanks alot for help ..
>
> what if we want to check specific
> 1) specific plugin lets say postie in wordpress ?
> 2) all of url under plugin ?
>
>
> thanks in advance.
>
> BR
>
> Zeeshan
>
>
> On Tue, Aug 7, 2012 at 10:48 PM, Jonathan Hursey <
> jonathan.hursey [at] adrevolution> wrote:
>
>> oops... I knew that
>>
>>
>> On Tue, Aug 7, 2012 at 3:45 PM, Hugo Cisneiros (Eitch) <
>> hugo.cisneiros [at] gmail> wrote:
>>
>>> On Mon, Aug 6, 2012 at 9:13 PM, Jonathan Hursey
>>> <jonathan.hursey [at] adrevolution> 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
>>>
>>> _______________________________________________
>>> varnish-misc mailing list
>>> varnish-misc [at] varnish-cache
>>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>>
>>
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc [at] varnish-cache
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
>

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.