From d0302acf25650f2a12b318b19cc7f69245931a1f Mon Sep 17 00:00:00 2001 From: Thomas LEBEAU Date: Fri, 13 Jun 2014 10:41:02 +0200 Subject: [PATCH] nginx conf --- conf/nginx.conf | 4 +++- scripts/install | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 710e974..578ee20 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,6 +1,8 @@ location PATHTOCHANGE { alias ALIASTOCHANGE; - rewrite ^/$ http://$server_name/admin permanent; + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } index index.php; try_files $uri $uri/ /index.php?$args; diff --git a/scripts/install b/scripts/install index c6f8efe..5c4f414 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,7 @@ 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* +sed -i "s@ALIASTOCHANGE@$final_path/admin@g" ../conf/nginx.conf* nginxconf=/etc/nginx/conf.d/$domain.d/yourls.conf sudo cp ../conf/nginx.conf $nginxconf sudo chown root: $nginxconf