diff --git a/conf/nginx.conf b/conf/nginx.conf index 576ce49..6b103cd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,8 +11,7 @@ location __PATH__/ { index index.php; # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) - try_files $uri $uri/ __PATH_HACK__/index.php?$query_string; - #if (!-e $request_filename) { rewrite ^ __PATH_HACK__/index.php last; } + try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; location ~* \.php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; diff --git a/scripts/change_url b/scripts/change_url index c56b44f..f6d417d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -84,12 +79,6 @@ then # Set global variables for nginx helper domain="$old_domain" path_url="$new_path" - # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) - if [ $path_url = "/" ]; then - ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf" - else - ynh_replace_string "__PATH_HACK__" "$path_url" "../conf/nginx.conf" - fi # Create a dedicated nginx config ynh_add_nginx_config fi diff --git a/scripts/install b/scripts/install index d734853..6151707 100644 --- a/scripts/install +++ b/scripts/install @@ -97,13 +97,6 @@ ynh_setup_source --dest_dir="$final_path" # NGINX CONFIGURATION #================================================= -# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) -if [ $path_url = "/" ]; then - ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf" -else - ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf" -fi - # Create a dedicated nginx config ynh_add_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index 0e92323..7baaacf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -160,13 +160,6 @@ fi #================================================= ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1 -# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) -if [ $path_url = "/" ]; then - ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf" -else - ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf" -fi - # Create a dedicated nginx config ynh_add_nginx_config