Fix nginx root path handling

This commit is contained in:
adminsopel
2026-05-01 09:20:57 +02:00
parent 7b87a979a5
commit 92d6f38de9

View File

@@ -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"