Welcome! Log In Create A New Profile

Advanced

Re: static files and 404

March 19, 2009 04:52PM
On Thu, Mar 19, 2009 at 01:26:29PM -0500, Nick Pearson wrote:

> Here's a simplified version of I use the following to accomplish this,
> inside my location block:
>
> if ($uri ~* (\.css|\.js|\.ico|\.gif|\.jpg|\.png)) {
> break;
> }
>
> Note that I haven't tested this simplified form directly, but I believe it
> should work.

"if ($uri ~" or "if ($request_filename ~" means that you should use
locations as here:

location / {
...
}

location ~* \.(?:css|js|ico|gif|jpg|png)$ {
...
}

> On Thu, Mar 19, 2009 at 1:14 PM, Marcelo Barbudas <nostef@gmail.com> wrote:
>
> > Hi,
> >
> > I have a setup where I am using nginx with RubyOnRails.
> >
> > The setup looks simple:
> > if (!-f $request_filename) {
> > proxy_pass http://domain1;
> > break;
> > }
> >
> > However I have a directory that holds images that sometimes get deleted.
> > People keep linking to those images and the 404s go to the rails process.
> >
> > How can I tell nginx that any request towards:
> > /images/subassets/*.gif
> > should never be forwarded to rails?
> >
> > --
> > Cheers,
> > M.
> >
> >

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

static files and 404

Marcelo Barbudas March 19, 2009 02:38PM

Re: static files and 404

Nick Pearson March 19, 2009 02:47PM

Re: static files and 404

Merlin March 19, 2009 03:39PM

Re: static files and 404

Igor Sysoev March 19, 2009 04:53PM

Re: static files and 404

Igor Sysoev March 19, 2009 04:52PM

Re: static files and 404

Marcelo Barbudas March 19, 2009 08:00PM

Re: static files and 404

Cliff Wells March 19, 2009 04:43PM

Re: static files and 404

Cliff Wells March 19, 2009 04:44PM

Re: static files and 404

Cliff Wells March 19, 2009 04:53PM

Re: static files and 404

Igor Sysoev March 19, 2009 05:01PM

Re: static files and 404

Marcelo Barbudas March 19, 2009 07:39PM

Re: static files and 404

Merlin March 19, 2009 08:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready