diff --git a/conf/nginx.conf b/conf/nginx.conf index 17b0e02..6577935 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ -location PATHTOCHANGE { - alias ALIASTOCHANGE; +location LOCATIONTOCHANGE { + alias ALIASTOCHANGE/; try_files $uri $uri/ PATHTOCHANGE/yourls-loader.php; @@ -16,4 +16,4 @@ location PATHTOCHANGE { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; -} \ No newline at end of file +} diff --git a/scripts/install b/scripts/install index c052c94..8607122 100644 --- a/scripts/install +++ b/scripts/install @@ -18,9 +18,6 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi -# Remove trailing "/" for next commands -path=${path%/} - # Generate random password db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') @@ -54,7 +51,8 @@ sudo sed -i "s/_yourlspath$path/g" $final_path/user/config.php sudo chown -R www-data: $final_path # Modify Nginx configuration file and copy it to Nginx conf directory -sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf* +sed -i "s@LOCATIONTOCHANGE@$path@g" ../conf/nginx.conf* +sed -i "s@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf* sed -i "s@DOMAINTOCHANGE@$domain@g" ../conf/nginx.conf* sed -i "s@ALIASTOCHANGE@$final_path@g" ../conf/nginx.conf* nginxconf=/etc/nginx/conf.d/$domain.d/yourls.conf