Skip to content

Commit

Permalink
Merge pull request #123 from os2display/hotfix/ip-logging
Browse files Browse the repository at this point in the history
1185: Ensured real ip is logged in nginx
  • Loading branch information
tuj authored Apr 19, 2024
2 parents cf31fe7 + dee8f0a commit 712073a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
All notable changes to this project will be documented in this file.

- [#123](https://github.com/os2display/display-client/pull/123)
- Ensured real ip is logged in nginx.
- [#124](https://github.com/os2display/display-client/pull/124)
- Changed to apply max-age 7d to all files and added cache busting to config.json and release.json.
- Added "loginCheckTimeout", "configFetchInterval", "refreshTokenTimeout", "releaseTimestampIntervalTimeout" to config.json.
- Simplified config.json.
Expand Down
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 712073a

Please sign in to comment.