From bf3aa84decba6e7c4714e4bb38979c59cd591c2c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 30 Jan 2021 13:46:56 +0100 Subject: [PATCH] Fix --- conf/nginx.conf | 40 +++++++++++++++++++++------------------- scripts/install | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index a1415db..7d452ba 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,27 +1,29 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/; + # Path to source + alias __FINALPATH__/; - index index.html; + index index.html; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } + # Force usage of https + f ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } - location __PATH__/http-bind { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_pass http://127.0.0.1:5290/http-bind; - proxy_set_header Host $host; - proxy_buffering off; - tcp_nodelay on; - access_log off; - } + location = __PATH__/http-bind { + proxy_pass http://localhost:5290/http-bind; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Forwarded-Port $server_port; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection “upgrade”; + } + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } diff --git a/scripts/install b/scripts/install index 7f93c07..c218935 100755 --- a/scripts/install +++ b/scripts/install @@ -59,7 +59,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, the source from sources folder mkdir -p $final_path && cp -a ../sources/* $final_path -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/index.html" +ynh_replace_string --match_string="__DOMAIN____PATH__" --replace_string="$domain$path_url" --target_file="$final_path/index.html" #================================================= # NGINX CONFIGURATION