Welcome! Log In Create A New Profile

Advanced

Re: Setting expires header bypasses app server

April 02, 2009 02:20PM
That's because it is hitting the location ~*
\.(js|css|jpg|jpeg|gif|png)$ { first

try this (until Igor comes up with something better)


location ~* \.(js|css|jpg|jpeg|gif|png)$ {
if (!-f $request_filename) {
proxy_pass http://thins;
break;
}
if (-f $request_filename) {
expires max;
break;
}
}

I don't know if the braces got aligned properly but that general idea.

On Thu, Apr 2, 2009 at 10:41 AM, nmk <nginx-forum@nginx.us> wrote:
>> It's because it is matching that regexp first.
>>
>> You could do your if (-f ) check inside of there
>> and it would probably
>> work, but that's kind of messy.
>
> I am doing a -f check in the location. Still doesn't work as I expect it to.
>
> Could you provide an example please?
>
>> I'm sure Igor can
>> post and give you a
>> much cleaner way to do the entire thing.
>
> I hope so. :-) I still haven't got it working.
>
> Best,
> Nickolay
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,700,755#msg-755
>
>
>
Subject Author Posted

Setting expires header bypasses app server

nmk April 01, 2009 06:34AM

Re: Setting expires header bypasses app server

mike April 01, 2009 01:06PM

Re: Setting expires header bypasses app server

nmk April 02, 2009 01:41PM

Re: Setting expires header bypasses app server

mike April 02, 2009 02:20PM

Re: Setting expires header bypasses app server

Cliff Wells April 02, 2009 03:41PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 305
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready