Hi all,
hi Maciej,
since it would be nice (not only to accord to data privacy law) to
anonymizie ip addressses in nginx logfiles I tried to achieve this with
existent debops roles. My approach is to log via syslog together wit
mmanon module.
As far as I found out - this doesn't work out of the box, because the
default.conf.j2 template already has a access_log line which is composed
with static log path root "/" and suffix .log:
access_log {{ (item.log_path | d(nginx_log_path)) + '/' +
item.access_log | d(item.filename | d(item.name if item.name is string
else item.name[0]) + '_access') }}.log{{ nginx_tpl_access_log_format }};
As far as I understood, this is not optional and configurable.
So I wrote a new template where I replaced these lines with:
access_log {{ item.syslog_access }};
error_log {{ item.syslog_error }};
and i can have in my config something like:
nginx__servers:
- name
[...]
syslog_access: "syslog:server=unix:/dev/log,tag=nginx_access"
syslog_error: "syslog:server=unix:/dev/log,tag=nginx_error"
Is it possible to store this template somwere in my project directory
instead of debops repository?
By the way: maybe it's worth to extend the default template with the
possibility to log to syslog instead of files?
Best regards
Jan