That depends on your actual requirements and objectives.
These are my requirements:
1) I have one fixed IP and several site to host there.
2) most of those sites will be NodeJS
3) user must type only URL, without any port:
https://w8k.jadermarasca.com.br to test.
4) apache/nginx must take care of redirect and everything must work transparently to users
I'm testing using w8k as hostname for domains jadermarasca.com.br, moresco-contabilidade.com.br , portalgap.com.br and valleruaro.adv.br.
So access to w8k to any of those domains should works.
I've it working for simple apps (without ANY other folder/files than basic initial website) :
https://w8k.jadermarasca.com.br and
https://w8k.moresco-contabilidade.com.br ... and even these are do not load css !
What I did:
a) I created 27NodeJS (see above) to get port redirect (ProxyPass and reverse)
b) each NodeJS app works on one different port : 3001 is jadermarasca.com.br , 3002 is moresco-contabilidade.com.br , 3003 is portalgap.com.br
c) I event tried to redirect on index.html ... it works for initial page, not for anything else
d) I add this to config file:
<VirtualHost 0.0.0.0:443>
ServerName w8k.portalgap.com.br
ServerAlias ftp.w8k.portalgap.com.br mail.w8k.portalgap.com.br proxy.w8k.portalgap.com.br serverlocal.w8k.portalgap.com.br wpad.w8k.portalgap.com.br www.w8k.portalgap.com.br
(...)
# Jm
RewriteCond %{HTTP_HOST} w8k.portalgap.com.br
RewriteRule ^(.*)$ http://w8k.portalgap.com.br:3003/$1 [L,R]
Or is this impossible ?
Thanks.