Forum: NGINX disable logging images or seperate image log files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73e4d5deb861a7efe53f3a12a54b33d8?d=identicon&s=25 Pahud (Guest)
on 2009-05-26 19:31
(Received via mailing list)
Hello list,

After some google search I guess this is yet discussed before. How do I:

1) disable nginx logging image requests(no .gif|.jpg|.png logging in
access_log)
2) keep logging image requests, but seperate it to another
file(main_access.log and img_access.log)
3) disable logging requests of some pattern or log them on another file

Any examples are appreciated.

pahud
2c6f80fff253635f12c249ef4f116796?d=identicon&s=25 Jim Ohlstein (Guest)
on 2009-05-26 19:52
(Received via mailing list)
Pahud wrote:
> Hello list,
>
> After some google search I guess this is yet discussed before. How do I:
>
> 1) disable nginx logging image requests(no . logging in access_log)

location ~*  \.(gif|jpg|png) {
    access_log   off;
    ...
}

Or if all are in a directory and it's subdirectories:

location ^~   /images/ {
    access_log   off;
    ...
}


See
> 2) keep logging image requests, but seperate it to another
> file(main_access.log and img_access.log)


location ~*  \.(gif|jpg|png)$ {
    access_log   /path/to/access.log;
    ...
}
> 3) disable logging requests of some pattern or log them on another file

Use a regex in "location" block. See
http://wiki.nginx.org/NginxHttpCoreModule#location.
>
> Any examples are appreciated.
>
> pahud

Jim
This topic is locked and can not be replied to.