mirror of
https://github.com/caprover/caprover
synced 2025-10-30 10:07:01 +00:00
Excluding local calls from nginx logs
This commit is contained in:
@@ -14,11 +14,22 @@ http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
geo $remote_addr $ip_in_log {
|
||||
|
||||
# CIDR Range IPs:
|
||||
172.16.0.0/12 0;
|
||||
10.0.0.0/8 0;
|
||||
192.168.0.0/16 0;
|
||||
|
||||
default 1;
|
||||
|
||||
}
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$host" "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
access_log /var/log/nginx/access.log main if=$ip_in_log;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
Reference in New Issue
Block a user