Add more generic cases
This commit is contained in:
parent
64bbd30989
commit
54c393cd99
1 changed files with 5 additions and 1 deletions
|
@ -57,7 +57,11 @@ nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
|||
# Change the path in the nginx config file
|
||||
if [ $change_path -eq 1 ]
|
||||
then
|
||||
ynh_replace_string "location $old_path" "location $new_path" "$nginx_conf_path"
|
||||
# Replace locations starting with old_path
|
||||
# Look for every location possible patterns (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location)
|
||||
sudo sed --in-place "s@location\( \(=\|~\|~\*\|\^~\)\)\? $old_path@location\1 $new_path@" "$nginx_conf_path"
|
||||
# Replace path in "return" directives
|
||||
sudo sed --in-place "s@return \([[:digit:]]\{3\}\) $old_path@return \1 $new_path@" "$nginx_conf_path"
|
||||
fi
|
||||
|
||||
# Change the domain for nginx
|
||||
|
|
Loading…
Reference in a new issue