1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Apache reverse-proxy for nodered

This commit is contained in:
Anish Mangal 2019-02-09 14:21:39 +00:00
parent 72142db7b8
commit ccef7ba2a1
3 changed files with 30 additions and 0 deletions

View file

@ -7,3 +7,6 @@ nodered_password_hash: $2b$08$oxgvoU9et3deSbXY8UNVTOWHSTQAyEASIal86RHVMqYQJhpPMN
# To generate a new password hash, run 'node-red-admin hash-pw' and enter the # To generate a new password hash, run 'node-red-admin hash-pw' and enter the
# new password. Paste the resulting hash above. After Ansible runs, username # new password. Paste the resulting hash above. After Ansible runs, username
# and password hash will be placed in: /home/nodered/.node-red/settings.js # and password hash will be placed in: /home/nodered/.node-red/settings.js
nodered_web_path: nodered
nodered_port: 1880

View file

@ -54,6 +54,31 @@
state: started state: started
when: nodered_enabled when: nodered_enabled
- name: Copy nodered.conf to apache sites-available
template:
backup: yes
src: nodered.conf.j2
dest: /etc/apache2/sites-available/nodered.conf
owner: root
group: root
mode: 0666
when: nodered_install
- name: Link nodered.conf to apache sites-enabled
file:
src: /etc/apache2/sites-available/nodered.conf
dest: /etc/apache2/sites-enabled/nodered.conf
owner: root
group: root
state: link
when: nodered_enabled
- name: Remove nodered.conf from apache sites-enabled
file:
path: /etc/apache2/sites-enabled/nodered.conf
state: absent
when: not nodered_enabled
- name: Add 'nodered' variable values to {{ iiab_ini_file }} - name: Add 'nodered' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
path: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"

View file

@ -0,0 +1,2 @@
ProxyPass /{{ nodered_web_path }} http://localhost:{{ nodered_port }}
ProxyPassReverse /{{ nodered_web_path }} http://localhost:{{ nodered_port }}