1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

Fix NGINX

This commit is contained in:
tituspijean 2020-11-24 23:40:11 +01:00
parent 837c3942e7
commit a5a5ea5e64
3 changed files with 23 additions and 9 deletions

View file

@ -9,18 +9,18 @@ location __PATH__/ {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.html index.php;
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
try_files $uri $uri/ __PATH_HACK__/index.php$is_args$args;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel.

View file

@ -70,6 +70,13 @@ ynh_setup_source --dest_dir="$final_path"
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
if [ $path_url = "/" ]; then
ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf"
else
ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf"
fi
# Create a dedicated NGINX config
ynh_add_nginx_config

View file

@ -102,6 +102,13 @@ ynh_secure_remove "$tmpdir"
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
if [ $path_url = "/" ]; then
ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf"
else
ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf"
fi
# Create a dedicated NGINX config
ynh_add_nginx_config