sophies-stuff #36
1 changed files with 19 additions and 0 deletions
|
@ -35,5 +35,24 @@ http {
|
|||
'' close;
|
||||
}
|
||||
|
||||
# GDPR compatible IP smashinator 5000000
|
||||
map $remote_addr $ip_anonym1 {
|
||||
default 0.0.0;
|
||||
"~(?P<ip>(\d+)\.(\d+))\.(\d+)\.\d+" $ip;
|
||||
"~(?P<ip>[^:]+:[^:]+):" $ip;
|
||||
}
|
||||
map $remote_addr $ip_anonym2 {
|
||||
default .0.0;
|
||||
"~(?P<ip>(\d+)\.(\d+)\.(\d+))\.\d+" .0.0;
|
||||
"~(?P<ip>[^:]+:[^:]+):" ::;
|
||||
}
|
||||
map $ip_anonym1$ip_anonym2 $ip_anonymized {
|
||||
default 0.0.0.0;
|
||||
"~(?P<ip>.*)" $ip;
|
||||
}
|
||||
log_format gdpr '$ip_anonymized - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"<stripped>" "$http_user_agent"';
|
||||
|
||||
include /etc/nginx/sites/*;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue