Tag Info

Hot answers tagged

3

The access_log directive is valid inside if, so you can simply add one there. However, its presence overrides any ones that appear above it in the hierarchy, so if you simply add one entry the request will not be logged to whatever access log you normally log for that server. To get around that, you can use two access_log directives inside the if, one ...


2

You don't happen to have some kind of proxy doing a check if server is alive? e.g. haproxy with check send-proxy ? :) This is only annoying as such with the extreme amount of logging it produces..in systemd it might be a bit more of a hassle to also cron job the log file to clean it up of any unneccessary entries. The option is to suppress the messages ...


1

Just changing the filenames will break all sorts of things in the web interface. Starting with viewing old logs, as you mentioned, but also including all of the trend graphs, availability reports, alert history, notification history, etc. You'd have to modify date format in the source and recompile to fix all of this. A better option is to set use_syslog=1 ...


1

Just putting access_log inside if, does not work However access_log only inside if inside location and from this thread we can see the workaround: Separate Nginx access log file for certain requests only if ($http_referer ~* (bad-domain.com)){ set $bad_domain 'yes'; } location / { if ($bad_domain = 'yes') { access_log logs/bad_domain.log; ...



Only top voted, non community-wiki answers of a minimum length are eligible