9 messages in ru.sysoev.nginxRe: Rewriting for revisioned URLs
FromSent OnAttachments
Brian KirkbrideMay 21, 2009 8:49 am 
Edho P AriefMay 21, 2009 9:09 am 
Edho P AriefMay 21, 2009 9:13 am 
Jauder HoMay 21, 2009 9:59 am 
Igor SysoevMay 21, 2009 10:02 am 
Brian KirkbrideMay 21, 2009 11:02 am 
Igor SysoevMay 21, 2009 11:06 am 
Jauder HoMay 21, 2009 11:38 am 
Brian KirkbrideMay 21, 2009 11:52 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:Re: Rewriting for revisioned URLsActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:May 21, 2009 10:02:35 am
List:ru.sysoev.nginx

On Thu, May 21, 2009 at 10:50:04AM -0500, Brian Kirkbride wrote:

Hi all,

I'm trying to switch us from LigHTTPD to NginX and have run into some issues. Any help is much appreciated.

We use revisioned URLs to allow for far-future caching of resources (e.g. http://example.com/r1234567890/site.css) and are having trouble getting this to work.

Basically we need to strip /r1234567890 from the front of the URI and set expires to max, then check for a file and fallback to FastCGI.

I've tried something like:

location ~ ^/r[0-9]+ { if ( $uri ~ ^/r([0-9]+)(/.*)$ ) { set $rev $1; set $realuri $2; } expires max; try_files $root/$realuri @catalyst; }

with no luck. Any ideas?

location ~ ^/r\d+(/.*)$ { expires max; try_files $1 @catalyst; }