Fix nginx config.
This commit is contained in:
parent
cffbb7cd58
commit
e4cea91ea8
1 changed files with 13 additions and 12 deletions
25
ansible/templates/nginx.conf
vendored
25
ansible/templates/nginx.conf
vendored
|
@ -72,16 +72,17 @@ server {
|
|||
expires max;
|
||||
}
|
||||
}
|
||||
# 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;
|
||||
}
|
||||
|
||||
# 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;
|
||||
|
|
Reference in a new issue