mirror of
https://yerbamate.ml/nutomic/peertube.social
synced 2024-11-24 21:48:21 -05:00
Anonymize IP addresses in nginx
This commit is contained in:
parent
948c249cb9
commit
3d08ebade0
@ -160,4 +160,17 @@ http {
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
|
||||
# Anonymize IP addresses
|
||||
# https://www.supertechcrew.com/anonymizing-logs-nginx-apache/
|
||||
map $remote_addr $remote_addr_anon {
|
||||
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0;
|
||||
~(?P<ip>[^:]+:[^:]+): $ip::;
|
||||
127.0.0.1 $remote_addr;
|
||||
::1 $remote_addr;
|
||||
default 0.0.0.0;
|
||||
}
|
||||
log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
|
||||
access_log /dev/stdout main;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user