diff --git a/roles/nodered/tasks/main.yml b/roles/nodered/tasks/main.yml index 329d1a327..34a800685 100644 --- a/roles/nodered/tasks/main.yml +++ b/roles/nodered/tasks/main.yml @@ -79,6 +79,11 @@ state: absent when: not nodered_enabled +- name: Enable proxy_wstunnel apache2 module + apache2_module: + state: present + name: proxy_wstunnel + - name: Restart apache2 service systemd: name: apache2 diff --git a/roles/nodered/templates/nodered.conf.j2 b/roles/nodered/templates/nodered.conf.j2 index 415fd08c3..72d6b99f1 100644 --- a/roles/nodered/templates/nodered.conf.j2 +++ b/roles/nodered/templates/nodered.conf.j2 @@ -1,2 +1,5 @@ -ProxyPass /{{ nodered_web_path }} http://localhost:{{ nodered_port }} -ProxyPassReverse /{{ nodered_web_path }} http://localhost:{{ nodered_port }} +ProxyPreserveHost On +ProxyRequests Off +ProxyPass /{{ nodered_web_path }}/debug/ws ws://localhost:1880/{{ nodered_web_path }}/debug/ws +ProxyPass /{{ nodered_web_path }} http://localhost:{{ nodered_port }}/{{ nodered_web_path }} +ProxyPassReverse /{{ nodered_web_path }} http://localhost:{{ nodered_port }}/{{ nodered_web_path }} diff --git a/roles/nodered/templates/settings.js.j2 b/roles/nodered/templates/settings.js.j2 index eb709304e..50923671c 100644 --- a/roles/nodered/templates/settings.js.j2 +++ b/roles/nodered/templates/settings.js.j2 @@ -96,7 +96,7 @@ module.exports = { // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot', // to apply the same root to both parts. - //httpRoot: '/red', + httpRoot: '/{{ nodered_web_path }}', // When httpAdminRoot is used to move the UI to a different root path, the // following property can be used to identify a directory of static content