From 07edc12c46eee1222ebaf06da890e4e0336cdcd6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 7 Jul 2022 07:47:36 +0200 Subject: [PATCH] Add path --- conf/nginx.conf | 4 +++- manifest.json | 8 +++++++- scripts/install | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7ae5255..03d5ced 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,6 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { + root __FINALPATH__/; } diff --git a/manifest.json b/manifest.json index 30d68b4..6281e85 100644 --- a/manifest.json +++ b/manifest.json @@ -31,7 +31,13 @@ { "name": "domain", "type": "domain" - } + }, + { + "name": "path", + "type": "path", + "example": "/gamja", + "default": "/gamja" + }, ] } } diff --git a/scripts/install b/scripts/install index 66de8bc..4c9f3a4 100755 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH app=$YNH_APP_INSTANCE_NAME @@ -100,7 +100,7 @@ ynh_script_progression --message="Building Gamja... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install --production popd #=================================================