r/nginx: Fix disabling access/error log files
It turns out _nginx_ has a built-in default value for `access_log` and `error_log`, even if they are omitted from the configuration file. To actually disable writing logs to a file, we need to explicitly specify `off`.unifi-restore
parent
b4f5b419e1
commit
61a4f64bbb
|
@ -6,6 +6,8 @@ user {{ nginx_user }};
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
{% if nginx_error_log_file %}
|
{% if nginx_error_log_file %}
|
||||||
error_log {{ nginx_error_log_file }};
|
error_log {{ nginx_error_log_file }};
|
||||||
|
{% elif not nginx_error_log_syslog|bool %}
|
||||||
|
error_log off;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if nginx_error_log_syslog|bool %}
|
{% if nginx_error_log_syslog|bool %}
|
||||||
error_log syslog:server=unix:/dev/log,facility=daemon,nohostname;
|
error_log syslog:server=unix:/dev/log,facility=daemon,nohostname;
|
||||||
|
@ -26,6 +28,8 @@ http {
|
||||||
|
|
||||||
{% if nginx_access_log_file %}
|
{% if nginx_access_log_file %}
|
||||||
access_log {{ nginx_access_log_file }} main;
|
access_log {{ nginx_access_log_file }} main;
|
||||||
|
{% elif not nginx_access_log_syslog|bool %}
|
||||||
|
access_log off;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if nginx_access_log_syslog|bool %}
|
{% if nginx_access_log_syslog|bool %}
|
||||||
access_log syslog:server=unix:/dev/log,facility=daemon,nohostname main;
|
access_log syslog:server=unix:/dev/log,facility=daemon,nohostname main;
|
||||||
|
|
Loading…
Reference in New Issue