Browse Source

nginx graylog

master
tobi 1 year ago
parent
commit
a2dde79ba6
1 changed files with 18 additions and 10 deletions
  1. +18
    -10
      deploy.yaml

+ 18
- 10
deploy.yaml View File

@@ -15,18 +15,26 @@ data:
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;
# send access logs to graylog
log_format graylog2_json escape=json '{ "timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '
'"request": "$request", '
'"request_method": "$request_method", '
'"host": "$host",'
'"upstream_cache_status": "$upstream_cache_status",'
'"upstream_addr": "$upstream_addr",'
'"http_x_forwarded_for": "$http_x_forwarded_for",'
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent" }';

access_log syslog:server=logs.tobias-huebner.org:12401 graylog2_json;

keepalive_timeout 65;

include /etc/nginx/conf.d/*.conf;



Loading…
Cancel
Save