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:
parent
ff1feb64d9
commit
ac80557832
3 changed files with 10 additions and 4 deletions
|
@ -1,10 +1,10 @@
|
||||||
location __PATH__/ {
|
location ^~ __PATH__/ {
|
||||||
|
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass http://localhost:__PORT__/;
|
proxy_pass http://localhost:__PORT____PATH__/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_redirect http:// https://;
|
proxy_redirect http:// https://;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|
|
@ -148,6 +148,9 @@ ynh_add_fpm_config
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
mkdir -p $final_path/data
|
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
|
# SETUP SYSTEMD
|
||||||
|
|
|
@ -155,8 +155,11 @@ ynh_add_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# 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
|
# SETUP LOGROTATE
|
||||||
|
|
Loading…
Add table
Reference in a new issue