From db3658f60fcffac7ee52369f7c003ad013894e3f Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Wed, 2 Sep 2015 01:57:37 +0200 Subject: [PATCH 1/2] Yet another path error --- conf/nginx.conf | 2 +- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0c9dca4..50d1df2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location PATHTOCHANGE { +location PATHTOCHANGE/ { alias ALIASTOCHANGE; 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 From 035ca114c77d5db71629fa622a9b0d6958b2bb6d Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Wed, 9 Sep 2015 00:41:46 +0200 Subject: [PATCH 2/2] Error in nginx.conf regarding non-root installations --- conf/nginx.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 50d1df2..dcec25e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -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; }