Skip to content

Commit a460bff

Browse files
authored
Merge pull request #101 from itk-dev/feature/real-ip
2167: Fixed correct IP in nginx logs
2 parents 185c07e + e6dd247 commit a460bff

File tree

14 files changed

+42
-13
lines changed

14 files changed

+42
-13
lines changed

templates/drupal-10/.docker/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ events {
77
worker_connections 1024;
88
}
99

10-
1110
http {
1211
proxy_temp_path /tmp/proxy_temp;
1312
client_body_temp_path /tmp/client_temp;
@@ -18,7 +17,7 @@ http {
1817
include /etc/nginx/mime.types;
1918
default_type application/octet-stream;
2019

21-
set_real_ip_from 172.16.0.0/8;
20+
set_real_ip_from 172.16.0.0/16;
2221
real_ip_recursive on;
2322
real_ip_header X-Forwarded-For;
2423

templates/drupal-10/.docker/templates/default.conf.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ server {
66

77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

9+
# This also needs to be set in the single server tag and not only in http.
10+
set_real_ip_from 172.16.0.0/16;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
914
location = /favicon.ico {
1015
log_not_found off;
1116
access_log off;

templates/drupal-7/.docker/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ events {
77
worker_connections 1024;
88
}
99

10-
1110
http {
1211
proxy_temp_path /tmp/proxy_temp;
1312
client_body_temp_path /tmp/client_temp;
@@ -18,7 +17,7 @@ http {
1817
include /etc/nginx/mime.types;
1918
default_type application/octet-stream;
2019

21-
set_real_ip_from 172.16.0.0/8;
20+
set_real_ip_from 172.16.0.0/16;
2221
real_ip_recursive on;
2322
real_ip_header X-Forwarded-For;
2423

templates/drupal-7/.docker/templates/default.conf.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ server {
66

77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

9+
# This also needs to be set in the single server tag and not only in http.
10+
set_real_ip_from 172.16.0.0/16;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
914
location = /favicon.ico {
1015
log_not_found off;
1116
access_log off;

templates/drupal-8/.docker/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ events {
77
worker_connections 1024;
88
}
99

10-
1110
http {
1211
proxy_temp_path /tmp/proxy_temp;
1312
client_body_temp_path /tmp/client_temp;
@@ -18,7 +17,7 @@ http {
1817
include /etc/nginx/mime.types;
1918
default_type application/octet-stream;
2019

21-
set_real_ip_from 172.16.0.0/8;
20+
set_real_ip_from 172.16.0.0/16;
2221
real_ip_recursive on;
2322
real_ip_header X-Forwarded-For;
2423

templates/drupal-8/.docker/templates/default.conf.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ server {
66

77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

9+
# This also needs to be set in the single server tag and not only in http.
10+
set_real_ip_from 172.16.0.0/16;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
914
location = /favicon.ico {
1015
log_not_found off;
1116
access_log off;

templates/drupal-9/.docker/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ events {
77
worker_connections 1024;
88
}
99

10-
1110
http {
1211
proxy_temp_path /tmp/proxy_temp;
1312
client_body_temp_path /tmp/client_temp;
@@ -18,7 +17,7 @@ http {
1817
include /etc/nginx/mime.types;
1918
default_type application/octet-stream;
2019

21-
set_real_ip_from 172.16.0.0/8;
20+
set_real_ip_from 172.16.0.0/16;
2221
real_ip_recursive on;
2322
real_ip_header X-Forwarded-For;
2423

templates/drupal-9/.docker/templates/default.conf.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ server {
66

77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

9+
# This also needs to be set in the single server tag and not only in http.
10+
set_real_ip_from 172.16.0.0/16;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
914
location = /favicon.ico {
1015
log_not_found off;
1116
access_log off;

templates/symfony-3/.docker/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ events {
77
worker_connections 1024;
88
}
99

10-
1110
http {
1211
proxy_temp_path /tmp/proxy_temp;
1312
client_body_temp_path /tmp/client_temp;
@@ -18,7 +17,7 @@ http {
1817
include /etc/nginx/mime.types;
1918
default_type application/octet-stream;
2019

21-
set_real_ip_from 172.16.0.0/8;
20+
set_real_ip_from 172.16.0.0/16;
2221
real_ip_recursive on;
2322
real_ip_header X-Forwarded-For;
2423

templates/symfony-3/.docker/templates/default.conf.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ server {
66

77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

9+
# This also needs to be set in the single server tag and not only in http.
10+
set_real_ip_from 172.16.0.0/16;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
914
location / {
1015
# try to serve file directly, fallback to app.php
1116
#try_files $uri /app.php$is_args$args;

0 commit comments

Comments
 (0)