Do you know the benefits of getting nginx or any other web-server running like a reverse-proxy while watching Node.JS? Exactly what does it provide?

(This is supposed for matters concerning web-applications, not web-pages).


I believe the finest benefit is the fact that you are then able to utilize exactly the same port (80) for multiple programs. Otherwise, you'd require a new Ip for every nodejs application you've. For the way you place some misconception, you may also configure different folders and subdomains to various nodejs applications running on different ports. If you are building something large or complex, this really is pretty great. Imagine having the ability to run your APIs on a single node application, your site from another, and also the drenched-in website (member's area, dashboard, etc.) in another application. Your load balancer can determine who must go where (* -> api.js,* -> dashboard.js, -> application.js). This is not merely helpful for scaling, but additionally when things break, not everything breaks at the same time.

Towards the maturity factor, meh. Nodejs + forever + node-http-proxy = Amazing. Run 1 proxy server for all your applications having a minimal config/complexity (lower possibility of failure). Then enjoy anything else. Be sure to firewall off your internal ports, though ).

Many people write down load balancing, which true, is really a benefit. However, load balancing is not something which many people may benefit from, since just one threaded, non-obstructing nodejs thread are designed for quite remarkably large loads. I really wouldn't even think about this like a difference personally. Load balancing is simple enough to implement when it's needed, but otherwise absolutely useless before you do.

Also note, should you choose opt for a non-node proxy solution (nginx, tornado, etc.), just don't play one that blocks. Apache blocks. Nginx does not. You won't want to discard among the finest advantages of choosing nodejs to begin with on the crummy server.

Getting a far more mature software as proxy is much better for security and reliability. Nginx, Apache yet others happen to be examined against numerous cases and utilized in production for a long time.

You may also use features from all of these web server that otherwise you would need to implement yourself or make use of a node.js module. Like caching, statistics, balancing, etc.

On the other hand you'd lose some features from node.js, realtime features like websockets (on port 80, you are able to still use other ports), page loading and with respect to the reverse proxy used, treatments for your caching and headers.