Welcome! Log In Create A New Profile

Advanced

is static access_log within if-in-location better than dynamic global?

Constantine A. Murenin
May 11, 2013 02:56PM
Hi,

According to http://nginx.org/r/access_log, the access_log directive
cannot be used within an `if` in `server`, only within an `if` in
`location`.

Indeed, it doesn't actually work within an `if` directly within
`server`, but variables can be used to seemingly achieve identical
result. Or is it?

Use of variables is documented to result in repeated open/close of the
log-files, potentially alleviated by a cache that is turned off by default.

As such, if I only want to have three `access_log` files in total, and
most of the requests in question are served from a single `location`,
would I be much better off in using `access_log` within an "if in
location" a couple of times, or using a single global `access_log` with
a single variable that could have only a few possible values, through
global `if`s, potentially with `open_log_file_cache`?

I guess using `access_log` without variables within "if in location"
would be much better, but I just want to confirm that it's the case.

Best regards,
Constantine.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

is static access_log within if-in-location better than dynamic global?

Constantine A. Murenin May 11, 2013 02:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready