I have been studying Node.js recently and came across some material on writing simple Node.js based servers. For example, the following.
var express = require(&qu
NodeJs creates its own server. As you can see, terminology is quite clear:
http.createServer(app).listen(3000);
Create a server and listen for http requests on port 3000.
We used nginx in one of our project, but it was more like a loadbalancer for multiple nodejs instances.
Lets say you have two nodejs instances running on port 3000 and 3001,
Now you can still use nginx
as a server to listen your actual http
calls on port 80
, and may want to redirect your request to nodejs
server or maybe some other server, more like a loadbalancer
. So you can still use whatever nginx
provides with nodejs
.
A good question already asked here.