Subdomain Vhost Proxy With Easy Apache4 For Node Application?

Max User

Registered
Sep 7, 2018
2
0
1
Nigeria
cPanel Access Level
Root Administrator
Hello, I have a subdomain set up `sub.example.com` for my domain `example.com` and I installed node on my VPS which I have root access to the VPS. I uploaded my Node files to subdomain folders. And started my Node at `IP:3000` which I verified to be working through my Host Providers. Now What I want is to Point sub.example.com to IP:3000. So I taught of Vhost is the answer as I saw online. So I added this file to /etc/apache2/conf.d/sub.example.com.conf with this content
<VirtualHost *:80>
ServerName sub.example.com

<Location "/">
ProxyPreserveHost On
ProxyPass http://IP:3000/
ProxyPassReverse http://IP:3000/
</Location>
</VirtualHost>​
and restarted apache but hmmffffs is not working. So How Do I point IP:3000 to sub.example.com
Regards,
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston