diff --git a/infrastructure/itkdev/etc/confd/templates/nginx.conf.tmpl b/infrastructure/itkdev/etc/confd/templates/nginx.conf.tmpl index dd5aae5b..e5db9bec 100644 --- a/infrastructure/itkdev/etc/confd/templates/nginx.conf.tmpl +++ b/infrastructure/itkdev/etc/confd/templates/nginx.conf.tmpl @@ -34,7 +34,11 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + set_real_ip_from 172.16.0.0/8; + real_ip_recursive on; + real_ip_header X-Forwarded-For; + + log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; diff --git a/infrastructure/os2display/etc/confd/templates/nginx.conf.tmpl b/infrastructure/os2display/etc/confd/templates/nginx.conf.tmpl index dd5aae5b..e5db9bec 100644 --- a/infrastructure/os2display/etc/confd/templates/nginx.conf.tmpl +++ b/infrastructure/os2display/etc/confd/templates/nginx.conf.tmpl @@ -34,7 +34,11 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + set_real_ip_from 172.16.0.0/8; + real_ip_recursive on; + real_ip_header X-Forwarded-For; + + log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';