node.js - Deploying a nodejs app with ExpressJS -


so have nodejs app running on port 8081:

http://mysite.com:8081/ 

i want access going http://mysite.com/ setup virtual host expressjs:

app.use(express.vhost('yugentext.com', app)); 

that seems easy, , doesn't work. confused how expressjs vhosts work?

if want these via express well, problem comes dns setup, not express code.

add a entry domain these:

127.0.0.1 localhost *.mysite.com *.www.mysite.com 

you should wait dns propagation. (from seconds hours).

if apache or other web server running vhost on port 80 there conflicts.

and other way:

nodejs , express far away performance offered apache , nginx (vhost/proxy stuff).

nginx>apache (fits better nodejs)

creates proxy mysite.com mysite.com:8080

on these way nodejs , express handles ui, methods, httpserver etc, , nginx or apache proxy , vhost, , managing static assets sooo fast.

check these config here: trouble nginx , multiple meteor/nodejs apps


Comments