Pahud
1
Hello list,
After some google search I guess this is yet discussed before. How do I:
- disable nginx logging image requests(no .gif|.jpg|.png logging in
access_log)
- keep logging image requests, but seperate it to another
file(main_access.log and img_access.log)
- disable logging requests of some pattern or log them on another file
Any examples are appreciated.
pahud
Pahud
2
Pahud wrote:
Hello list,
After some google search I guess this is yet discussed before. How do I:
- 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
- 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;
…
}
- disable logging requests of some pattern or log them on another file
Use a regex in “location” block. See
Module ngx_http_core_module.
Any examples are appreciated.
pahud
Jim