Welcome! Log In Create A New Profile

Advanced

How to match static files that have dynamic numeric extensions are the end of the file name?

Posted by deeblock 
Hello Nginx'ers !

I'd like to match static contents (CSS , JS, image files etc) but when I check the source of my script ,
I see the extensions as for example
example.com/externals/mootools/mootools-1.2.4-core-yc.js?c=197
/mootools/mootools-1.2.4.4-more-yc.js?c=196
/smoothbox/smoothbox4.js?c=193

I can manually configure nginx to match .css , .js using

location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm|jpg?c=159|jpeg?c=159|gif?c=159|png?c=159|ico?c=159|css?c=159|zip?c=159|tgz?c=159|gz?c=159|rar?c=159|bz2?c=159|pdf?c=159|txt?c=159|tar?c=159|wav?c=159|bmp?c=159|rtf?c=159|js?c=159|flv?c=159|swf?c=159|html?c=159|htm)$
{
#something

}

But how can I match "Ext?c=XYZ" , where ext=any extension ; and X,Y,Z are any numerical values ?
Please, help .
Thank you .
Deeblock
Will ext?c=(.*) work ?

Thanks again !
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 288
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready