Location and access_log off;

Hello,

I tried to turn off static file logging using this:

    location ~* .(css|js|gif|jpg|jpeg|ico)$ {
        access_log off;
    }

It turned the logging off, that part worked. But it also didn’t serve
any of these files anymore. Same effect was when I tried to redirect
static file log to another file - again no images on web page.

I tried this with 0.7.61 and 0.8.9 versions.

What could be wrong?

Thanks!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5038,5038#msg-5038

On Thu, Aug 20, 2009 at 11:20:48AM -0400, vilts wrote:

I tried this with 0.7.61 and 0.8.9 versions.

What could be wrong?

What is in error_log ?

Excellent, both versions work. Thanks.

My problem was, that I had the root directive inside ‘location / {}’, so
the other location didn’t pick that up.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5038,5073#msg-5073

On Thu, Aug 20, 2009 at 12:18:55PM -0400, vilts wrote:

Hi,

Looks like it is trying to search that file from .

2009/08/20 16:14:49 19796#0: *1 open() “/usr/local/nginx-passenger/html/favicon.ico” failed (2: No such file or directory)
2009/08/20 16:14:49 19796#0: *2 open() “/usr/local/nginx-passenger/html/images/nav1_bg1.gif” failed (2: No such file or directory)
2009/08/20 16:14:49 19796#0: *3 open() “/usr/local/nginx-passenger/html/gallery/model3_with_sheath_thumb.jpg” failed (2: No such file or directory)

You should add “root” inside

    location ~* .(css|js|gif|jpg|jpeg|ico)$ {
        access_log off;
        root  /path/to/files;
    }

Hi,

Looks like it is trying to search that file from .

2009/08/20 16:14:49 19796#0: *1 open()
“/usr/local/nginx-passenger/html/favicon.ico” failed (2: No such file or
directory)
2009/08/20 16:14:49 19796#0: *2 open()
“/usr/local/nginx-passenger/html/images/nav1_bg1.gif” failed (2: No such
file or directory)
2009/08/20 16:14:49 19796#0: *3 open()
“/usr/local/nginx-passenger/html/gallery/model3_with_sheath_thumb.jpg”
failed (2: No such file or directory)

What is in error_log ?


Igor S.
http://sysoev.ru/en/

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5038,5045#msg-5045

2009/8/21 Igor S. [email protected]:

You should add “root” inside

    location ~* .(css|js|gif|jpg|jpeg|ico)$ {
      access_log off;
      root  /path/to/files;
    }

What is in error_log ?

or put the root outside

root /path/to/root;

location ~* … {

}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs