From 73dbf03c9a7405094cdc5261153121ca5230f6a4 Mon Sep 17 00:00:00 2001 From: thelittlefireman Date: Sat, 2 Jan 2021 14:15:18 +0100 Subject: [PATCH] add USE_LIMIT_CONN zone to global config --- entrypoint/global-config.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/entrypoint/global-config.sh b/entrypoint/global-config.sh index f103252..cbae6b1 100644 --- a/entrypoint/global-config.sh +++ b/entrypoint/global-config.sh @@ -245,6 +245,13 @@ else replace_in_file "/etc/nginx/nginx.conf" "%LIMIT_REQ_ZONE%" "" fi +# connection limiting +if [ "$(has_value USE_LIMIT_CONN yes)" != "" ] ; then + replace_in_file "/etc/nginx/nginx.conf" "%LIMIT_CONN_ZONE%" "limit_conn_zone \$binary_remote_addr zone=ddos:${LIMIT_CONN_CACHE};" +else + replace_in_file "/etc/nginx/nginx.conf" "%LIMIT_CONN_ZONE%" "" +fi + # DNSBL if [ "$(has_value USE_DNSBL yes)" != "" ] ; then replace_in_file "/etc/nginx/nginx.conf" "%DNSBL_CACHE%" "lua_shared_dict dnsbl_cache 10m;"