Fix nginx root path handling
This commit is contained in:
@@ -6,6 +6,11 @@ source ./_common.sh
|
||||
# packaging v2 passes these variables to scripts.
|
||||
domain=${YNH_APP_ARG_DOMAIN:?Missing domain}
|
||||
path=$(normalize_path "${YNH_APP_ARG_PATH:-/}")
|
||||
if [ "$path" = "/" ]; then
|
||||
nginx_path="/"
|
||||
else
|
||||
nginx_path="$path/"
|
||||
fi
|
||||
admin_user=${YNH_APP_ARG_ADMIN_USER:-${YNH_APP_ARG_ADMIN:-admin}}
|
||||
admin_password=${YNH_APP_ARG_ADMIN_PASSWORD:-${YNH_APP_ARG_PASSWORD:-}}
|
||||
if [ -z "$admin_password" ]; then
|
||||
@@ -43,7 +48,7 @@ mkdir -p "/etc/nginx/conf.d/$domain.d"
|
||||
cp "$YNH_APP_BASEDIR/conf/nginx.conf" "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
sed -i \
|
||||
-e "s#__PORT__#$port#g" \
|
||||
-e "s#__PATH__#$path#g" \
|
||||
-e "s#__PATH__#$nginx_path#g" \
|
||||
"/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
chown -R "$app:$app" "$install_dir" "$data_dir" "$config_dir"
|
||||
|
||||
Reference in New Issue
Block a user