Sidehistorik
...
Node-RED has no (as far as I know currently, any users or admin/management in front of it by default, and I wanted to be able to use it from home and work/work-vpn... so I created a dual stack of Reverse Proxies:
| draw.io Diagram | ||||||
|---|---|---|---|---|---|---|
|
Setting the browser to http://nodered.mos-eisley.dk it hits my Confluence Server (in a Datacenter) and the Apache2 on it proxies it to http://cantina,mos-eisley.dk:1890 (Fiber Router with port forward to Home laptop), and the Apache2 on the Laptop proxies it to sparrow:1880 (the Docker container on the Home Laptop).
...
| Kodeblok |
|---|
<VirtualHost nodered.mos-eisley.dk:80> ServerName nodered.mos-eisley.dk LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined ErrorLog ${APACHE_LOG_DIR}/nodered.mos-eisley.dk-error.log CustomLog ${APACHE_LOG_DIR}/nodered.mos-eisley.dk-access.log combined RewriteEngine on RewriteCond %{HTTP:Upgrade} ^WebSocket$ [NC] RewriteCond %{HTTP:Connection} Upgrade$ [NC] RewriteRule .*/(.*) "ws://cantina.mos-eisley.dk:1890/$1" [P,L] ProxyPreserveHost On ProxyRequests Off ProxyPass / http://cantina.mos-eisley.dk:1890/ ProxyPassReverse / http://cantina.mos-eisley.dk:1890/ <Proxy *> Order deny,allow Deny from all Allow from xxx.xxx.xxx.xxx Allow from yyy.yyy.yyy.yyy Authtype Basic Authname "Password Required" AuthUserFile /etc/apache2/.htpasswd Require valid-user </Proxy><Proxy> </VirtualHost> |
Creating password:
...
| Kodeblok | ||
|---|---|---|
| ||
<VirtualHost *:1890> ServerAdmin webmaster@localhost RewriteEngine on RewriteCond %{HTTP:Upgrade} ^WebSocket$ [NC] RewriteCond %{HTTP:Connection} Upgrade$ [NC] RewriteRule .*/(.*) "ws://localhost:1880/$1" [P,L] ProxyPreserveHost On ProxyRequests Off ProxyPass / http://localhost:1880/ ProxyPassReverse / http://localhost:1880/ <Proxy *> Order deny,allow Deny from all Allow from 77.243.52.144 # www.mos-eisley.dk Allow from 10 # Local Lan </Proxy><Proxy> </VirtualHost> |
With this setup I can use it from xxx.xxx.xxx.xxx and yyy.yyy.yyy.yyy that represents some well known adresses like work and fiber.
...