Replace #sub_path_only and #root_path_only in the template *before* calling ynh_add_config, otherwise the it ain't in the checksum computation

This commit is contained in:
Alexandre Aubin 2021-01-23 00:15:35 +01:00
parent c023b177fe
commit 72822ce987

View file

@ -20,15 +20,16 @@ ynh_add_nginx_config () {
local finalnginxconf="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_add_config --template="../conf/nginx.conf" --destination="$finalnginxconf"
if [ "${path_url:-}" != "/" ]
then
ynh_replace_string --match_string="^#sub_path_only" --replace_string="" --target_file="$finalnginxconf"
ynh_replace_string --match_string="^#sub_path_only" --replace_string="" --target_file="../conf/nginx.conf"
else
ynh_replace_string --match_string="^#root_path_only" --replace_string="" --target_file="$finalnginxconf"
ynh_replace_string --match_string="^#root_path_only" --replace_string="" --target_file="../conf/nginx.conf"
fi
ynh_add_config --template="../conf/nginx.conf" --destination="$finalnginxconf"
ynh_systemd_action --service_name=nginx --action=reload
}