From e037e4c232a73c5ab34432ab08d8bd87acaee739 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 29 Jan 2021 10:29:28 +0100 Subject: [PATCH] Fix --- conf/.env.example | 2 +- conf/nginx.conf | 7 +++++-- scripts/install | 1 + scripts/upgrade | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/conf/.env.example b/conf/.env.example index 283c975..825d67e 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -18,7 +18,7 @@ APP_KEY=SomeRandomString # If you change this in the future you may need to run a command # to update stored URLs in the database. Command example: # php artisan bookstack:update-url https://old.example.com https://new.example.com -APP_URL=https:__DOMAIN__ +APP_URL=https:__DOMAIN____PATH__ # Application default language # The default language choice to show. diff --git a/conf/nginx.conf b/conf/nginx.conf index 9f99315..d278a9f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,9 +9,8 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - try_files $uri $uri/ __PATH__/index.php?$query_string; - index index.php; + try_files $uri $uri/ @bookstack; #try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { @@ -28,3 +27,7 @@ location __PATH__/ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + +location @bookstack { + rewrite ^__PATH__/(.*)$ __PATH__/index.php?/$1 last; +} diff --git a/scripts/install b/scripts/install index 8bf3d42..6e7d095 100644 --- a/scripts/install +++ b/scripts/install @@ -107,6 +107,7 @@ cp -a ../conf/.env.example $final_path/.env ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.env" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.env" +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/.env" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env" ynh_store_file_checksum $final_path/.env diff --git a/scripts/upgrade b/scripts/upgrade index 942bb34..283e6f3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) #=================================================