Skip to content

Commit

Permalink
1185: Ensured real ip is logged in nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
cableman committed Apr 16, 2024
1 parent 8930b44 commit ae46123
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion infrastructure/itkdev/etc/confd/templates/nginx.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"';

Expand Down

0 comments on commit ae46123

Please sign in to comment.