Welcome! Log In Create A New Profile

Advanced

Re: Rewriting for revisioned URLs

May 21, 2009 02:07PM
On Thu, May 21, 2009 at 01:02:50PM -0500, Brian Kirkbride wrote:

> Igor Sysoev wrote:
> >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;
> >}
> >
> >
>
> Thanks Igor, but no luck. It always falls back to @catalyst, even
> when the file exists. I have debugging enabled and logging, but I
> don't see anything in the error log to show where it is looking.
>
> I also tried this as well with no luck:
>
> location ~ ^/r\d+(/.*)$ {
> set $look $1;
> expires max;
> try_files $look @catalyst;
> }
>
> This is on 0.6.36 btw.

Probably you need to set "root" inside this location or at server level.


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Rewriting for revisioned URLs

Brian Kirkbride May 21, 2009 11:50AM

Re: Rewriting for revisioned URLs

edogawaconan May 21, 2009 12:09PM

Re: Rewriting for revisioned URLs

edogawaconan May 21, 2009 12:14PM

Re: Rewriting for revisioned URLs

Jauder Ho May 21, 2009 01:00PM

Re: Rewriting for revisioned URLs

Igor Sysoev May 21, 2009 01:02PM

Re: Rewriting for revisioned URLs

Brian Kirkbride May 21, 2009 02:02PM

Re: Rewriting for revisioned URLs

Igor Sysoev May 21, 2009 02:07PM

Re: Rewriting for revisioned URLs

Jauder Ho May 21, 2009 02:38PM

Re: Rewriting for revisioned URLs

Brian Kirkbride May 21, 2009 02:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready