File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ GATEWAY_DENIED_IPS=
313
313
# @run
314
314
GATEWAY_USERS =
315
315
316
+ # Status and ping access Allowed IPs: Comma-separated list of IP addresses that are allowed to access the /status or /ping pages.
317
+ # Uncomment and specify IPs to enable. Example: GATEWAY_STATUS_ALLOWED_IPS=10.0.0.1,10.0.1.1
318
+ # @run
319
+ GATEWAY_STATUS_ALLOWED_IPS =
316
320
317
321
# HTTP requests quota management.
318
322
# Manage http incoming request limits by verbs using the "ngx_http_limit_req_module" module.
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ services:
35
35
- GATEWAY_ALLOWED_IPS
36
36
- GATEWAY_DENIED_IPS
37
37
- GATEWAY_USERS
38
+ - GATEWAY_STATUS_ALLOWED_IPS
38
39
- GATEWAY_CSP
39
40
- HTTP_REQUEST_LIMITS
40
41
- HTTP_READ_REQUEST_LIMIT_MEMORY
Original file line number Diff line number Diff line change 65
65
# GATEWAY_DENIED_IPS="172.1.0.1,172.1.0.2"
66
66
# GATEWAY_USERS="user1(password1),user2(password2)
67
67
touch /etc/nginx/restrictions
68
+ touch /etc/nginx/status_allowed_ip
68
69
touch /etc/nginx/.htpasswd
69
70
70
71
if [[ ! -z $GATEWAY_ALLOWED_IPS ]] || [[ ! -z $GATEWAY_DENIED_IPS ]] || [[ ! -z $GATEWAY_USERS ]]; then
@@ -89,7 +90,16 @@ if [[ ! -z $GATEWAY_ALLOWED_IPS ]] || [[ ! -z $GATEWAY_DENIED_IPS ]] || [[ ! -z
89
90
echo " deny all;" >> /etc/nginx/restrictions
90
91
fi
91
92
fi
93
+
94
+ if [[ ! -z $GATEWAY_STATUS_ALLOWED_IPS ]]; then
95
+ for status_ip_allowed in $( echo $GATEWAY_STATUS_ALLOWED_IPS | sed " s/,/ /g" )
96
+ do
97
+ echo " allow $status_ip_allowed ;" >> /etc/nginx/status_allowed_ip
98
+ done
99
+ fi
100
+
92
101
unset GATEWAY_USERS
93
102
unset GATEWAY_DENIED_IPS
94
103
unset GATEWAY_ALLOWED_IPS
104
+ unset GATEWAY_STATUS_ALLOWED_IPS
95
105
exec " $@ "
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ server {
62
62
include fastcgi_params;
63
63
include fastcgi_extended_params;
64
64
fastcgi_pass backend;
65
+ include status_allowed_ip;
66
+ deny all;
65
67
}
66
68
67
69
location /simplesaml/ {
You can’t perform that action at this time.
0 commit comments