diff --git a/template/base-nginx-conf.ejs b/template/base-nginx-conf.ejs index c8c5fb6..6657da7 100644 --- a/template/base-nginx-conf.ejs +++ b/template/base-nginx-conf.ejs @@ -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;