I have multiple node-red servers running behind a HAProxy reverse proxy which runs as apart of a pfSense box.
I want to access different node-red instances by accessing the pfSense box at different path. For example:
http://example.com/node-red1 --> xxx.xxx.xxx.xxx/
http://example.com/node-red2 --> yyy.yyy.yyy.yyy/
Also I need to access the dashboard of node ui in the same way, e.g.:
http://example.com/node-red1/ui --> xxx.xxx.xxx.xxx/ui
http://example.com/node-red2/ui --> xxx.xxx.xxx.xxx/ui
I though that this would be easy to achieve with HAProxy but I keep having problems. I have done the following:
- Created a FrontEnd with different access control lists:
Path starts with: node-red1 --> Action: Use backend node-red1
Path starts with: node-red2 --> Action: USe backend node-red2
Created two different BackEnds:
Backend node-red1:
Server: Forward To xxx.xxx.xxx.xxx
Backend node-red2
Server: Forward To yyy.yyy.yyy.yyy
Unfortunately, although the traffic is sent to the correct server, the node-red server cannot handle path /node-red1
or /node-red1/ui
and therefore I get page not found 404. I assumed that rewriting the path should work, but I cannot get it to work.
Can someone help me with setting up HAProxy?
Thanks