fix autoconf bug when removing config with multiple server name and increase default LIMIT_CONN_MAX for average website with HTTP2

This commit is contained in:
florian 2021-04-26 11:39:12 +02:00
parent 02f9fbe5fc
commit 42b7a57f01
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
2 changed files with 7 additions and 4 deletions

View File

@ -151,13 +151,16 @@ class Config :
def remove(self, vars) :
try :
# Get first server name
first_server_name = vars["SERVER_NAME"].split(" ")[0]
# Check if file exists
if not os.path.isfile("/etc/nginx/" + vars["SERVER_NAME"] + "/server.conf") :
utils.log("[!] /etc/nginx/" + vars["SERVER_NAME"] + "/server.conf doesn't exist")
if not os.path.isfile("/etc/nginx/" + first_server_name + "/server.conf") :
utils.log("[!] /etc/nginx/" + first_server_name + "/server.conf doesn't exist")
return False
# Remove the folder
shutil.rmtree("/etc/nginx/" + vars["SERVER_NAME"])
shutil.rmtree("/etc/nginx/" + first_server_name)
return True
except Exception as e :
utils.log("[!] Error while deactivating config : " + str(e))

View File

@ -106,7 +106,7 @@ LIMIT_REQ_RATE="${LIMIT_REQ_RATE-1r/s}"
LIMIT_REQ_BURST="${LIMIT_REQ_BURST-2}"
LIMIT_REQ_CACHE="${LIMIT_REQ_CACHE-10m}"
USE_LIMIT_CONN="${USE_LIMIT_CONN-yes}"
LIMIT_CONN_MAX="${LIMIT_CONN_MAX-10}"
LIMIT_CONN_MAX="${LIMIT_CONN_MAX-50}"
LIMIT_CONN_CACHE="${LIMIT_CONN_CACHE-10m}"
PROXY_REAL_IP="${PROXY_REAL_IP-no}"
PROXY_REAL_IP_FROM="${PROXY_REAL_IP_FROM-192.168.0.0/16 172.16.0.0/12 10.0.0.0/8}"