Need help with rewrite rule

Chris Cortese cortese.consulting at gmail.com
Wed Feb 25 06:15:09 MSK 2009


In Apache, I use the following rule.  It runs the combinator script, 
which serializes, minimizes, and gzips a list of javascript files:

RewriteRule ^/javascript/(.*\.js) /combine.php?type=javascript&files=$1

In nginx, I've tried many things, to no avail.  Right now I have:

 rewrite ^/javascript/(.*\.js)$ /combine.php?type=javascript&files=$1 last;

When I load my page and expand the HTML in firebug, at the place where I 
have:

<script type="text/javascript" 
src="http://mysite.com/javascript/prototype.js,effects.js,builder.js,lightbox_live.js,box.js"></script>

...it shows me 1 line as follows:

effects.js,builder.js,lightbox_live.js,box.js


Surely wildcards in nginx are greedy right?  Can anybody see what's 
wrong here?


Thanks,
Chris






More information about the nginx mailing list