Skip to content

Commit 83bc303

Browse files
committed
Update nginx conf to add custom docker ip range and allow it to be set by env variable
1 parent 953d1b0 commit 83bc303

File tree

17 files changed

+17
-32
lines changed

17 files changed

+17
-32
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
set_real_ip_from 172.16.0.0/16;
21-
real_ip_recursive on;
22-
real_ip_header X-Forwarded-For;
20+
# Note: set_real_ip_from is only set in the server block to make i configurable
2321

2422
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2523
'$status $body_bytes_sent "$http_referer" '

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ 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.
109
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
set_real_ip_from 172.16.0.0/16;
21-
real_ip_recursive on;
22-
real_ip_header X-Forwarded-For;
20+
# Note: set_real_ip_from is only set in the server block to make i configurable
2321

2422
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2523
'$status $body_bytes_sent "$http_referer" '

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ 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.
109
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
set_real_ip_from 172.16.0.0/16;
21-
real_ip_recursive on;
22-
real_ip_header X-Forwarded-For;
20+
# Note: set_real_ip_from is only set in the server block to make i configurable
2321

2422
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2523
'$status $body_bytes_sent "$http_referer" '

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ 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.
109
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
set_real_ip_from 172.16.0.0/16;
21-
real_ip_recursive on;
22-
real_ip_header X-Forwarded-For;
20+
# Note: set_real_ip_from is only set in the server block to make i configurable
2321

2422
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2523
'$status $body_bytes_sent "$http_referer" '

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ 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.
109
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
set_real_ip_from 172.16.0.0/16;
21-
real_ip_recursive on;
22-
real_ip_header X-Forwarded-For;
20+
# Note: set_real_ip_from is only set in the server block to make i configurable
2321

2422
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2523
'$status $body_bytes_sent "$http_referer" '

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ 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.
109
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

0 commit comments

Comments
 (0)