Skip to content

Commit 712073a

Browse files
authored
Merge pull request #123 from os2display/hotfix/ip-logging
1185: Ensured real ip is logged in nginx
2 parents cf31fe7 + dee8f0a commit 712073a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
All notable changes to this project will be documented in this file.
44

55
- [#123](https://github.com/os2display/display-client/pull/123)
6+
- Ensured real ip is logged in nginx.
7+
- [#124](https://github.com/os2display/display-client/pull/124)
68
- Changed to apply max-age 7d to all files and added cache busting to config.json and release.json.
79
- Added "loginCheckTimeout", "configFetchInterval", "refreshTokenTimeout", "releaseTimestampIntervalTimeout" to config.json.
810
- Simplified config.json.

infrastructure/itkdev/etc/confd/templates/nginx.conf.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ http {
3434
include /etc/nginx/mime.types;
3535
default_type application/octet-stream;
3636

37-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
37+
set_real_ip_from 172.16.0.0/8;
38+
real_ip_recursive on;
39+
real_ip_header X-Forwarded-For;
40+
41+
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
3842
'$status $body_bytes_sent "$http_referer" '
3943
'"$http_user_agent" "$http_x_forwarded_for"';
4044

infrastructure/os2display/etc/confd/templates/nginx.conf.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ http {
3434
include /etc/nginx/mime.types;
3535
default_type application/octet-stream;
3636

37-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
37+
set_real_ip_from 172.16.0.0/8;
38+
real_ip_recursive on;
39+
real_ip_header X-Forwarded-For;
40+
41+
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
3842
'$status $body_bytes_sent "$http_referer" '
3943
'"$http_user_agent" "$http_x_forwarded_for"';
4044

0 commit comments

Comments
 (0)