From 7422d5742e7bd18e421f272745a6d7e91465413d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Wed, 19 Dec 2018 00:34:06 +0100 Subject: [PATCH] Fix Nginx problem --- conf/nginx.conf | 1 - scripts/_common.sh | 13 +------------ scripts/change_url | 2 +- scripts/install | 2 +- scripts/upgrade | 2 +- 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 2802c89..e462a9c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,3 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { proxy_pass http://localhost:__PORT__; proxy_set_header Host $host; diff --git a/scripts/_common.sh b/scripts/_common.sh index 4cd71f3..7d7908f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -23,17 +23,6 @@ else your hardware and the result of the command \"uname -m\"." 1 fi -#================================================= -# CONFIGURE NGINX -#================================================= -config_nginx() { - if [ "$path_url" != "/" ] - then - ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf" - fi - ynh_add_nginx_config -} - #================================================= # CREATE FOLDERS #================================================= @@ -46,7 +35,7 @@ create_dir() { #================================================= config_gitlab() { create_dir - + gitlab_conf_path="$config_path/gitlab.rb" ynh_backup_if_checksum_is_different $gitlab_conf_path diff --git a/scripts/change_url b/scripts/change_url index 9347400..d72a000 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -84,7 +84,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated nginx config - config_nginx + ynh_add_nginx_config fi # Change the domain for nginx diff --git a/scripts/install b/scripts/install index a42ae1f..ede2903 100644 --- a/scripts/install +++ b/scripts/install @@ -70,7 +70,7 @@ ynh_app_setting_set $app unicorn_port $portUnicorn #================================================= # Create a dedicated nginx config -config_nginx +ynh_add_nginx_config #================================================= # CONFIGURE GITLAB diff --git a/scripts/upgrade b/scripts/upgrade index e0b662d..3aff0f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,7 +55,7 @@ path_url=$(ynh_normalize_url_path $path_url) #================================================= # Modify Nginx configuration file and copy it to Nginx conf directory -config_nginx +ynh_add_nginx_config #================================================= # CONFIGURE GITLAB