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

Mailing List Archive: Varnish: Misc

Problem with regular expression.

 

 

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


abraham.sustaita at buscacorp

Jun 23, 2012, 9:59 PM

Post #1 of 4 (482 views)
Permalink
Problem with regular expression.

I have in my system this two kind of url's for files:

http://site.com/img.jpg
http://site.com/img.jpg?123

I have this regular expression:

if (req.http.Host == "s3.files.fileserver.com" && req.url ~
"\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)$") {
}

but it only match the second one. How should I change it so it can match
both urls?

Thanks in advance.


jonathan.hursey at adrevolution

Jun 23, 2012, 10:03 PM

Post #2 of 4 (454 views)
Permalink
Re: Problem with regular expression. [In reply to]

"\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)?"


On Sat, Jun 23, 2012 at 11:59 PM, Abraham Cruz Sustaita <
abraham.sustaita [at] buscacorp> wrote:

> I have in my system this two kind of url's for files:
>
> http://site.com/img.jpg
> http://site.com/img.jpg?123
>
> I have this regular expression:
>
> if (req.http.Host == "s3.files.fileserver.com" && req.url ~
> "\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)$") {
> }
>
> but it only match the second one. How should I change it so it can match
> both urls?
>
> Thanks in advance.
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>


abraham.sustaita at buscacorp

Jun 23, 2012, 10:19 PM

Post #3 of 4 (440 views)
Permalink
Re: Problem with regular expression. [In reply to]

Thanks a lot. It works!

2012/6/23 Jonathan Hursey <jonathan.hursey [at] adrevolution>

> "\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)?"
>
>
> On Sat, Jun 23, 2012 at 11:59 PM, Abraham Cruz Sustaita <
> abraham.sustaita [at] buscacorp> wrote:
>
>> I have in my system this two kind of url's for files:
>>
>> http://site.com/img.jpg
>> http://site.com/img.jpg?123
>>
>> I have this regular expression:
>>
>> if (req.http.Host == "s3.files.fileserver.com" && req.url ~
>> "\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)$") {
>> }
>>
>> but it only match the second one. How should I change it so it can match
>> both urls?
>>
>> Thanks in advance.
>>
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc [at] varnish-cache
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
>


jonathan.hursey at adrevolution

Jun 24, 2012, 12:37 AM

Post #4 of 4 (440 views)
Permalink
Re: Problem with regular expression. [In reply to]

:) glad to help.

On Sun, Jun 24, 2012 at 12:19 AM, Abraham Cruz Sustaita <
abraham.sustaita [at] buscacorp> wrote:

> Thanks a lot. It works!
>
> 2012/6/23 Jonathan Hursey <jonathan.hursey [at] adrevolution>
>
>> "\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)?"
>>
>>
>> On Sat, Jun 23, 2012 at 11:59 PM, Abraham Cruz Sustaita <
>> abraham.sustaita [at] buscacorp> wrote:
>>
>>> I have in my system this two kind of url's for files:
>>>
>>> http://site.com/img.jpg
>>> http://site.com/img.jpg?123
>>>
>>> I have this regular expression:
>>>
>>> if (req.http.Host == "s3.files.fileserver.com" && req.url ~
>>> "\.(flv|mp4|jpg|xml|png|gif)(\?[a-z0-9]+)$") {
>>> }
>>>
>>> but it only match the second one. How should I change it so it can match
>>> both urls?
>>>
>>> Thanks in advance.
>>>
>>>
>>> _______________________________________________
>>> 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.