File tree 3 files changed +12
-3
lines changed
itkdev/nginx/etc/confd/templates
os2display/nginx/etc/confd/templates
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
4
4
5
5
## [ Unreleased]
6
6
7
+ - [ #204 ] ( https://github.com/os2display/display-api-service/pull/204 )
8
+ - Ensured real ip is logged in nginx.
7
9
- [ #200 ] ( https://github.com/os2display/display-api-service/pull/200 )
8
10
- Updated oidc internal documentation.
9
11
- [ #205 ] ( https://github.com/os2display/display-api-service/pull/205 )
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ http {
37
37
include /etc/nginx/mime.types;
38
38
default_type application/octet-stream;
39
39
40
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
40
+ set_real_ip_from 172.16.0.0/8;
41
+ real_ip_recursive on;
42
+ real_ip_header X-Forwarded-For;
43
+
44
+ log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
41
45
'$status $body_bytes_sent "$http_referer" '
42
46
'"$http_user_agent" "$http_x_forwarded_for"';
43
47
Original file line number Diff line number Diff line change @@ -37,10 +37,13 @@ http {
37
37
include /etc/nginx/mime.types;
38
38
default_type application/octet-stream;
39
39
40
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
40
+ set_real_ip_from 172.16.0.0/8;
41
+ real_ip_recursive on;
42
+ real_ip_header X-Forwarded-For;
43
+
44
+ log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
41
45
'$status $body_bytes_sent "$http_referer" '
42
46
'"$http_user_agent" "$http_x_forwarded_for"';
43
-
44
47
error_log /dev/stderr;
45
48
access_log /dev/stdout main;
46
49
You can’t perform that action at this time.
0 commit comments