From 429aa6182a952134d8ad785b7e39454176e9f5e6 Mon Sep 17 00:00:00 2001 From: Titus PiJean Date: Wed, 22 Feb 2017 19:06:03 +0100 Subject: [PATCH] Update nginx conf in upgrade After #30 --- scripts/upgrade | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 27057af..f7b8fbb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,14 +33,17 @@ sudo chmod -R 755 $src_path # Modify Nginx configuration file and copy it to Nginx conf directory ### Nginx ### if [ $path = "/" ]; then -nginx_conf=../conf/nginx_root.conf +nginxconf="../conf/nginx.conf" +if [ $path = "/" ]; then + sed -i "s@YNH_WWW_ROOTPATH@@g" ../conf/nginx.conf + sed -i "s@/YNH_WWW_ROOTAPP@@g" ../conf/nginx.conf else -nginx_conf=../conf/nginx.conf + sed -i "s@YNH_WWW_ROOTPATH@$path@g" ../conf/nginx.conf + sed -i "s@YNH_WWW_ROOTAPP@$app@g" ../conf/nginx.conf fi -sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf -sed -i "s@YNH_WWW_ALIAS@$app/@g" $nginx_conf -sed -i "s@YNH_WWW_APP@$app@g" $nginx_conf -sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf +sed -i "s@YNH_WWW_PATH@$path@g" $nginxconf +sed -i "s@YNH_WWW_FINALPATH@$final_path@g" $nginxconf +sudo cp $nginxconf /etc/nginx/conf.d/$domain.d/$app.conf # If a dedicated php-fpm process is used: #