diff --git a/autoconf/Config.py b/autoconf/Config.py index 210aef6..ec78795 100644 --- a/autoconf/Config.py +++ b/autoconf/Config.py @@ -95,7 +95,7 @@ class Config : vars_defaults.update(vars_instances) vars_defaults.update(vars) # Call site-config.sh to generate the config - proc = subprocess.run(["/bin/su", "-s", "/bin/sh", "-c", "/opt/entrypoint/site-config.sh" + " " + vars["SERVER_NAME"], "nginx"], env=vars_defaults, capture_output=True) + proc = subprocess.run(["/bin/su", "-s", "/bin/sh", "-c", "/opt/entrypoint/site-config.sh" + " \"" + vars["SERVER_NAME"] + "\"", "nginx"], env=vars_defaults, capture_output=True) if proc.returncode == 0 and vars_defaults["MULTISITE"] == "yes" and self.__swarm : proc = subprocess.run(["/bin/su", "-s", "/opt/entrypoint/multisite-config.sh", "nginx"], env=vars_defaults, capture_output=True) if proc.returncode == 0 : diff --git a/entrypoint/site-config.sh b/entrypoint/site-config.sh index 6bf2642..85075b8 100644 --- a/entrypoint/site-config.sh +++ b/entrypoint/site-config.sh @@ -9,10 +9,7 @@ # get nginx path and override multisite variables NGINX_PREFIX="/etc/nginx/" if [ "$MULTISITE" = "yes" ] ; then - first_server="$1" - if [ ! -f "/usr/sbin/nginx" ] ; then - first_server=$(echo "$1" | cut -d ' ' -f 1) - fi + first_server=$(echo "$1" | cut -d ' ' -f 1) NGINX_PREFIX="${NGINX_PREFIX}${first_server}/" if [ ! -d "$NGINX_PREFIX" ] ; then mkdir "$NGINX_PREFIX"