Created
May 20, 2021 18:17
-
-
Save xopez/8ab32ec91faad1f3ee2be37a384b7d55 to your computer and use it in GitHub Desktop.
nginx snippet for anonymized log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map $remote_addr $remote_addr_anon { | |
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0; | |
~(?P<ip>[^:]+:[^:]+): $ip::; | |
default 0.0.0.0; | |
} | |
log_format combined_ssl '$remote_addr_anon - $remote_user [$time_local] ' | |
'$ssl_protocol/$ssl_cipher ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent"'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment