diff --git a/conf/nginx.conf b/conf/nginx.conf index c11e4b0..48948a8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,10 @@ -location __PATH__/ { +location ^~ __PATH__/ { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://localhost:__PORT__/; + proxy_pass http://localhost:__PORT____PATH__/; proxy_set_header Host $host; proxy_redirect http:// https://; proxy_http_version 1.1; diff --git a/scripts/install b/scripts/install index 99e3b7e..846678f 100755 --- a/scripts/install +++ b/scripts/install @@ -148,6 +148,9 @@ ynh_add_fpm_config # SPECIFIC SETUP #================================================= mkdir -p $final_path/data +cp $final_path/settings.js $final_path/data/settings.js +ynh_replace_string "//httpRoot: '/red'," "httpRoot: '$path_url'," "$final_path/data/settings.js" +ynh_replace_string "//ui: { path: "ui" }," "ui: { path: "/ui/" }," "$final_path/data/settings.js" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 4ee9635..83cbd5b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -155,8 +155,11 @@ ynh_add_fpm_config #================================================= # SPECIFIC UPGRADE #================================================= -# ... -#================================================= +if [ ! -f $final_path/data/settings.js ]; then + cp $final_path/settings.js $final_path/data/settings.js +fi +ynh_replace_string "//httpRoot: '/red'," "httpRoot: '$path_url'," "$final_path/data/settings.js" +ynh_replace_string "//ui: { path: "ui" }," "ui: { path: "/ui/" }," "$final_path/data/settings.js" #================================================= # SETUP LOGROTATE