diff --git a/conf/nginx.conf b/conf/nginx.conf index 0c9dca4..dcec25e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location PATHTOCHANGE { +location PATHTOCHANGE/ { alias ALIASTOCHANGE; @@ -17,12 +17,12 @@ location PATHTOCHANGE { fastcgi_param SCRIPT_FILENAME $request_filename; } - location ^~ /bin/ { + location ^~ PATHTOCHANGE/bin/ { deny all; return 403; } - location ^~ /config/ { + location ^~ PATHTOCHANGE/config/ { deny all; return 403; } @@ -35,7 +35,7 @@ location PATHTOCHANGE { rewrite ^PATHTOCHANGE/rest/(.*)\.view$ PATHTOCHANGE/rest/index.php?action=$1 last; rewrite ^PATHTOCHANGE/rest/fake/(.+)$ PATHTOCHANGE/play/$1 last; } - location /rest { + location PATHTOCHANGE/rest { limit_except GET POST { deny all; } diff --git a/scripts/install b/scripts/install index 49ec8c7..264b542 100644 --- a/scripts/install +++ b/scripts/install @@ -53,7 +53,7 @@ sudo sed -i "s@RANDOMKEYTOCHANGE@$random_key@g" $final_path/config/ampache.cfg.p 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@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf* sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf* sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ampache.conf diff --git a/scripts/upgrade b/scripts/upgrade index 7d00f8b..e02caf0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ sudo sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.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@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf* sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf* sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ampache.conf