Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why install server (Nginx, Apache...) with Node.js? [duplicate]

Possible Duplicate:
Why do we need apache under Node.js express web framework?

I wonder why I should install a server such as Nginx or Apache with Node.js. I used to think that the server can help me to handle cache control or something more. But I found out that the Connect static middleware already does it, right?

like image 518
Trantor Liu Avatar asked Jun 18 '12 08:06

Trantor Liu


1 Answers

If you don't know why you need Nginx or Apache on top of Node.js, then you don't need it.

Nginx does a few things faster (and in some cases easier to configure) than Node.js: proxying, url rewriting, http caching, redirection, static file serving, and load balancing.

If you experience that your Node.js code for any of these roles are growing complex, or turn out to be performance bottlenecks, it's worth investigating. Until then, no need to bother.

like image 97
Deestan Avatar answered Oct 27 '22 01:10

Deestan