From 3e4e814bbb4636d335d43cc73886f78a8ba46c8d Mon Sep 17 00:00:00 2001 From: Alexis Gavoty Date: Sun, 20 Jul 2014 14:08:59 +0200 Subject: [PATCH 1/3] [fix] Subpath install --- conf/nginx.conf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 6e8d3c9..d2bfccb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,6 @@ -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - rewrite PATHTOCHANGE/(.*) /$1 break; +location PATHTOCHANGE/ { rewrite ^PATHTOCHANGE$ PATHTOCHANGE/ permanent; proxy_pass http://localhost:9001/; - proxy_redirect / PATHTOCHANGE/; proxy_set_header Host $host; proxy_buffering off; } From d0e8162272d62429afea49de07a3ad67cde66985 Mon Sep 17 00:00:00 2001 From: Alexis Gavoty Date: Sun, 20 Jul 2014 14:09:59 +0200 Subject: [PATCH 2/3] [fix] Do not force HTTPS (done by SSOwat) --- conf/nginx.conf-nosub | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/conf/nginx.conf-nosub b/conf/nginx.conf-nosub index 9a0fd70..954771d 100644 --- a/conf/nginx.conf-nosub +++ b/conf/nginx.conf-nosub @@ -1,9 +1,6 @@ location / { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } proxy_pass http://localhost:9001/; proxy_set_header Host $host; - # be carefull, this line doesn't override any proxy_buffering on set in a conf.d/file.conf + # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf proxy_buffering off; } From 741b369d3546757f00cb2cada2ccdcfe04ccfd23 Mon Sep 17 00:00:00 2001 From: Alexis Gavoty Date: Sun, 20 Jul 2014 14:14:15 +0200 Subject: [PATCH 3/3] [fix] Handle path correctly + syntax fixes --- scripts/install | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 59bc2b2..a4e256d 100644 --- a/scripts/install +++ b/scripts/install @@ -11,6 +11,9 @@ 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') @@ -55,16 +58,16 @@ 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@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf* -if [ $path != "/" ]; +if [ "$path" = "" ]; then - sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/etherpadlite.conf -else sudo cp ../conf/nginx.conf-nosub /etc/nginx/conf.d/$domain.d/etherpadlite.conf +else + sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/etherpadlite.conf fi # Reload Nginx and regenerate SSOwat conf sudo service nginx reload -if [ $is_public = "Yes" ]; +if [ "$is_public" = "Yes" ]; then sudo yunohost app setting etherpadlite skipped_uris -v "/" fi