Quantcast

location and access_log off;

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

location and access_log off;

lpugoy
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: location and access_log off;

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

> 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?

What is in error_log ?


--
Igor Sysoev
http://sysoev.ru/en/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: location and access_log off;

lpugoy
In reply to this post by lpugoy
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 Sysoev
> http://sysoev.ru/en/

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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: location and access_log off;

Igor Sysoev
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;
        }

> > What is in error_log ?


--
Igor Sysoev
http://sysoev.ru/en/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: location and access_log off;

Edho P Arief
2009/8/21 Igor Sysoev <[hidden email]>:

> 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;
>        }
>
>> > What is in error_log ?
>

or put the root outside

root /path/to/root;

location ~* ... {
   ...
}

--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: location and access_log off;

lpugoy
In reply to this post by lpugoy
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


Loading...