6 messages in ru.sysoev.nginxrewriting a filename in any directory
FromSent OnAttachments
AaronJan 22, 2009 10:30 pm 
Igor SysoevJan 23, 2009 12:50 am 
AaronJan 23, 2009 8:08 am 
Igor SysoevJan 23, 2009 8:53 am 
AaronJan 23, 2009 10:47 am 
Igor SysoevJan 23, 2009 10:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:rewriting a filename in any directoryActions...
From:Aaron (bom@gmail.com)
Date:Jan 22, 2009 10:30:38 pm
List:ru.sysoev.nginx

I am trying to achieve the following:

Request: http://www.domain.com/images/afv-585785-something.gif Would normally retrieve from : /public/images/afv-585785-something.gif

I need it to actually retrieve : /public/images/something.gif

So basically it needs to remove the "afv-######-" portion from the file request.

I am doing this for cache/expire versioning purposes. I tried the following but it only works on the root folder and not subdirectories.

location / { rewrite ^(.*)/afv-(.*)-(.*)$ $1/$3 last; }

What am I doing wrong?

Thanks, Bompus