Node-red URL via port not working for apache httpd VirtualHost

I'm moving to a new (modern) linux AWS server, and it's going well. I can run node-red and access nicely. These are not docker, and guarded now by pm2 (thanks for that).

I also have a HTTPD rewrite rule so the port isn't needed (eg. host.com/bot == host.com:2000).

But for some reason when I add VirtualHosts, which point to the same IP address where node-red is running, two thing happen:

  1. I cannot get the port access to work (eg. vhost.com:2000)
  2. The redirect works but only to the main host (eg. RewriteRule /bot to host.com:2000) vs (Rewrite /bot vhost.com:2000).

On my old linux, these worked and I can't see what is different (except 4 proxy shown below)

Here is one of my Vhost files that works (host.com is main, vhost.com is virtual one)

<VirtualHost *:443>
  Servername vhost.com
  SSLCerts ...
  
  ProxyRequests Off
  ProxyPreserveHost On
  SSLProxyEngine on

   # node-red
   # /bot -> :2000
   RewriteRule ^/bot$ bot/ [L,R=301]
   ProxyPass "/bot" "https://host.com:2000"
   ProxyPassReverse "/bot" "https://host.com:2000"

# VERSUS old linux which worked:
   ProxyPass "/bot" "https://vhost.com:2000"
<VirtualHost>

NOTE: on the new apache httpd 2.4.66 (dec 2025) they require

   SSLProxyVerify none
   SSLProxyCheckPeerCN off
   SSLProxyCheckPeerName off
   SSLProxyCheckPeerExpire off

And my ancient AWS (2.2.34 Nov 2017) didn't use these.

Any ideas?

NOTE: Things work with the rewrite, but I have old links that use the port and I'm trying to keep them working.

NOTE2: I also don't know if the port definitions on AWS are somehow not assigned to the vhosts? Although the firewall doesn't know about my vhosts (just DNS addresses)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.