Hi,
a customer has this in his .htaccess file (among other things):
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
This is to enable versioning of various files, so you can have long
"Expires" on them and still update them as needed while retaining the
old ones, if needed.
I want to deliver static files directly from nginx, so I created this:
location ~* ^(.+)\.(\d+)\.(js|css|png|jpg|gif|gzip)$ {
rewrite ^(.+)\.(\d+)\.(js|css|png|jpg|gif|gzip)$ $1.$3 ;
expires 1h;
}
This works in most cases, except for files which already have a version
number of some sort.
Namely:
coda-slider.1.1.1.1452703531.js
and two others from the jquery framework.
What's wrong with my nginx rewrite?
Because in apache, the rewrite rule works as intended.
nginx 1.8.0 on FreeBSD 10-amd64.
Regards
Rainer
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx