Reputation: 6106
Why should I proxy requests through to my Node.JS server using something like Nginx?
Why not allow access to the node server directly?
Upvotes: 0
Views: 74
Reputation: 1627
I recommend you to read chapter 3 of "Deploying Node.js" by Sandro Pasquali (Packt Publishing) specially from page 69 onwards.
I will cite a couple relevant of paragraphs:
Using Nginx
According to http://www.linuxjournal.com/magazine/nginx-high-performance-web-server-and-reverse-proxy: "Nginx is able to serve more requests per second with less resources because of its architecture. It consists of a master process, which delegates work to one or more worker processes. Each worker handles multiple requests in an event-driven or asynchronous manner using special functionality from the Linux kernel (epoll/select/poll). This allows Nginx to handle a large number of concurrent requests quickly with very little overhead."
Load balancing with Node
File serving speeds are, of course, not the only reason you might use a proxy such as Nginx. It is often true that network topology characteristics make a reverse proxy the better choice, especially when the centralization of common services, such as compression, makes sense.
Upvotes: 0
Reputation: 8635
Internet is unfriendly and hard to survive place.
Having Nginx between your client and Node.js obviously allows you to use the advantages Nginx offers. So what are these?
Summing it up, Nginx will do the server stuff, so that developing your application, you do not need to worry about the administrative and common configuration aspects of a web server.
Upvotes: 1