Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

is static access_log within if-in-location better than dynamic global? (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>