Skip to content

Commit

Permalink
[enh] Handle root path in nginx conf (#361)
Browse files Browse the repository at this point in the history
Avoid to put a double slash when the path is /.  
That can induce some errors in a nginx config.
  • Loading branch information
maniackcrudelis authored and alexAubin committed Sep 30, 2017
1 parent f3c16e7 commit 220c447
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/helpers.d/backend
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ ynh_add_nginx_config () {
# To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable.
# Substitute in a nginx config file only if the variable is not empty
if test -n "${path_url:-}"; then
# path_url_slash_less if path_url or a blank value if path_url is only '/'
path_url_slash_less=${path_url%/}
ynh_replace_string "__PATH__/" "$path_url_slash_less/" "$finalnginxconf"
ynh_replace_string "__PATH__" "$path_url" "$finalnginxconf"
fi
if test -n "${domain:-}"; then
Expand Down

0 comments on commit 220c447

Please sign in to comment.