syslog integration and fail2ban improvement

This commit is contained in:
bunkerity
2020-08-30 17:33:59 +02:00
parent cd19841ec3
commit f30a06d943
7 changed files with 40 additions and 22 deletions

View File

@@ -61,8 +61,9 @@ http {
# enable/disable sending nginx version
server_tokens %SERVER_TOKENS%;
# where to write logs
access_log /var/log/access.log;
# write logs to local syslogd
access_log syslog:server=unix:/dev/log,nohostname,facility=local0 combined;
error_log syslog:server=unix:/dev/log,nohostname,facility=local0,severity=warn;
# server config
include /etc/nginx/server.conf;

View File

@@ -585,15 +585,15 @@ html_errors = On
; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog
error_log = syslog
; The syslog ident is a string which is prepended to every message logged
; to syslog. Only used when error_log is set to syslog.
;syslog.ident = php
syslog.ident = php
; The syslog facility is used to specify what type of program is logging
; the message. Only used when error_log is set to syslog.
;syslog.facility = user
syslog.facility = local1
; Set this to disable filtering control characters (the default).
; Some loggers only accept NVT-ASCII, others accept anything that's not
@@ -605,7 +605,7 @@ html_errors = On
; all (all characters)
; raw (like "all", but messages are not split at newlines)
; http://php.net/syslog.filter
;syslog.filter = ascii
syslog.filter = ascii
;windows.show_crt_warning
; Default value: 0

2
confs/syslog.conf Normal file
View File

@@ -0,0 +1,2 @@
local0.* /var/log/nginx.log
local1.* /var/log/php.log