1
0
Fork 0

nginx: Improve logging

This commit is contained in:
Daniel Kempkens 2023-03-13 23:28:01 +01:00
parent 8ebbe7b9dd
commit 80193701a2
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -9,6 +9,20 @@
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedBrotliSettings = true; recommendedBrotliSettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
commonHttpConfig = ''
map $remote_addr $remote_addr_anon {
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0;
~(?P<ip>[^:]+:[^:]+): $ip::;
default 0.0.0.0;
}
log_format combined_anon '$remote_addr_anon - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log logs/access.log combined_anon;
'';
}; };
networking.firewall.interfaces = networking.firewall.interfaces =