1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nodered_ynh.git synced 2024-09-03 19:46:25 +02:00

[fix] proxy pass path for dashboard extension

Dashboard extension "manually" encodes the path /ui, which requires
to rewrite the nginx proxy path and set the proper settings in the app
This commit is contained in:
tituspijean 2020-03-31 19:47:07 +00:00
parent ff1feb64d9
commit ac80557832
3 changed files with 10 additions and 4 deletions

View file

@ -1,10 +1,10 @@
location __PATH__/ {
location ^~ __PATH__/ {
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://localhost:__PORT__/;
proxy_pass http://localhost:__PORT____PATH__/;
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;

View file

@ -148,6 +148,9 @@ ynh_add_fpm_config
# SPECIFIC SETUP
#=================================================
mkdir -p $final_path/data
cp $final_path/settings.js $final_path/data/settings.js
ynh_replace_string "//httpRoot: '/red'," "httpRoot: '$path_url'," "$final_path/data/settings.js"
ynh_replace_string "//ui: { path: "ui" }," "ui: { path: "/ui/" }," "$final_path/data/settings.js"
#=================================================
# SETUP SYSTEMD

View file

@ -155,8 +155,11 @@ ynh_add_fpm_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# ...
#=================================================
if [ ! -f $final_path/data/settings.js ]; then
cp $final_path/settings.js $final_path/data/settings.js
fi
ynh_replace_string "//httpRoot: '/red'," "httpRoot: '$path_url'," "$final_path/data/settings.js"
ynh_replace_string "//ui: { path: "ui" }," "ui: { path: "/ui/" }," "$final_path/data/settings.js"
#=================================================
# SETUP LOGROTATE