1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

try change nginx.conf and how to add a line on config.local.php

This commit is contained in:
Robles Rodolphe 2020-04-08 13:53:16 +02:00
parent 6e6bfca2ac
commit cbc7e7005d
2 changed files with 25 additions and 17 deletions

View file

@ -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.

View file

@ -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