nginx: only log if a cookie is sent

This commit is contained in:
Miraty 2022-11-01 00:25:14 +01:00
parent 9316ab1a80
commit 3f755b9f24
1 changed files with 5 additions and 1 deletions

View File

@ -26,9 +26,13 @@ http {
gzip_static on;
# Logging
map $http_cookie $loggable {
"" 0;
default 1;
}
log_format niver '|$time_local| [$remote_addr]@$server_name {$ssl_protocol $ssl_cipher} $status $body_bytes_sent "$request" "$http_user_agent"';
access_log /var/log/nginx/access.log niver;
error_log /var/log/nginx/error.log notice;
access_log /var/log/nginx/access.log niver if=$loggable;
# Disable useless/dangerous features
etag off;