From cbc7e7005df96b721ee72df0376b620337fed008 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Wed, 8 Apr 2020 13:53:16 +0200 Subject: [PATCH] try change nginx.conf and how to add a line on config.local.php --- conf/nginx.conf | 37 ++++++++++++++++++++++--------------- scripts/install | 5 +++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index b366318..586c8d6 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,28 +1,35 @@ location __PATH__ { # Path to source - alias __FINALPATH__/www; + root __FINALPATH__/www ; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - # Example PHP configuration (remove if not used) - index index.php /_route.php;; - - # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file - #client_max_body_size 50M; - - location ~ [^/]\.php(/|$) { + location / { try_files $uri $uri/ index.php /_route.php; - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; + index index.php /_route.php; } + +location ~ \.php { + try_files $uri $uri/ /_route.php; + fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; + +# location ~ [^/]\.php(/|$) { +# try_files $uri $uri/ index.php /_route.php; +# fastcgi_split_path_info ^(.+?\.php)(/.*)$; +# fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; +# fastcgi_index index.php; +# include fastcgi_params; +# fastcgi_param REMOTE_USER $remote_user; +# fastcgi_param PATH_INFO $fastcgi_path_info; +# fastcgi_param SCRIPT_FILENAME $request_filename; +} # PHP configuration end # Include SSOWAT user panel. diff --git a/scripts/install b/scripts/install index b11cf9a..b3f4799 100644 --- a/scripts/install +++ b/scripts/install @@ -84,11 +84,12 @@ ynh_setup_source --dest_dir="$final_path" # and copy in local.dist.php #================================================= -cp -a $final_path/config.dist.php $final_path/config.local.php +echo "const WWW_URI = '$path_url';" >> $final_path/config.local.php +#cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" # ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +#ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" #================================================= # Files owned by user app