From 1b4c09bc1dbb64ca6e775937734b9bfdb90b8e7f Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 17:56:51 +0200 Subject: [PATCH] Update the On/Off error code parameter Revert nginx config --- conf/nginx.conf | 3 +-- scripts/config | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5971601..e522e75 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,8 +6,7 @@ location __PATH__/ { # Default indexes and catch-all index index.html index.php; - # try_files $uri $uri/ __PATH__/index.php?$args =404; - try_files $uri $uri/ __PATH__/index.php?$args; + try_files $uri $uri/ __PATH__/index.php?$args =404; # Prevent useless logs location = __PATH__/favicon.ico { diff --git a/scripts/config b/scripts/config index 42a5e9d..d2b5e8c 100644 --- a/scripts/config +++ b/scripts/config @@ -151,10 +151,14 @@ ynh_app_config_apply() { if [ "${changed[custom_error_file]}" == "true" ] then CUSTOM_ERROR_FILE=$custom_error_file -# ynh_add_config --template="nginx-code-error.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" - ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" - else - ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" + nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" + + if [ "$custom_error_file" ] + then + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + else + ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" + fi fi if [ "$phpversion" != "none" ]