Ross
Ross

Reputation: 13

Is it possible to use node.js server without having the Port number appear in the URL.

I have a VPS using apache on port 80, but want to use node.js for a subdomain, without the port node will be using appear in the address bar.

Upvotes: 1

Views: 1167

Answers (1)

digwig
digwig

Reputation: 154

Yes it is possible

In your apache virtual host file configure with the following:

 <VirtualHost *:80>
  ServerName subdomain.myapp.com

 ProxyRequests off

<Proxy *>
        Order allow,deny
        Allow from all
</Proxy>

ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost on
</VirtualHost>

You should have NameVirtualHost *:80

Upvotes: 1

Related Questions