Skip to content

Commit

Permalink
Merge pull request #204 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 91d8bc2 + ae0ca46 commit d32f7eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- [#204](https://github.com/os2display/display-api-service/pull/204)
- Ensured real ip is logged in nginx.
- [#200](https://github.com/os2display/display-api-service/pull/200)
- Updated oidc internal documentation.
- [#205](https://github.com/os2display/display-api-service/pull/205)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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 @@ -37,10 +37,13 @@ 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"';

error_log /dev/stderr;
access_log /dev/stdout main;

Expand Down

0 comments on commit d32f7eb

Please sign in to comment.