Fix change url

This commit is contained in:
Josué Tille 2023-11-01 17:02:55 +01:00
parent 59875cae23
commit 570184ac1e
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF

View file

@ -53,19 +53,6 @@ ynh_change_url_nginx_config() {
local old_nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
local new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$old_nginx_conf_path"
# Set global variables for NGINX helper
domain="$old_domain"
path="$new_path"
path_url="$new_path"
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
# Change the domain for NGINX
if [ $change_domain -eq 1 ]
then
@ -73,6 +60,17 @@ ynh_change_url_nginx_config() {
mv "$old_nginx_conf_path" "$new_nginx_conf_path"
ynh_store_file_checksum --file="$new_nginx_conf_path"
fi
# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$old_nginx_conf_path"
# Set global variables for NGINX helper
path="$new_path"
path_url="$new_path"
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
ynh_systemd_action --service_name=nginx --action=reload
}