Basically Nginx is used as a reverse proxy to serve requests from a pool of Node.js processes, each with its own internal port. So you would set up the Node.js app to run internally on ports 8080, 8081, 8082, and 8083 for example. (If you have a quad core server this assures that under extreme load each processor can be fully utilized by one single-thread Node.js process). Then Nginx serves requests on port 80 by fetching the response from one of those four internal ports in round robbin fashion.
If one of the processes crashes due to a bug or you want to specifically restart it so that a new code update takes effect in production then Nginx will automatically remove it from the pool while it is down and then add it back when it comes back online. When you are pushing out code updates you can cycle each process one at a time to do a zero downtime deploy.
The other cool thing that you can do with Nginx reverse proxies is use the proxy_cache as a robust cache layer to almost completely remove stress from your blog under high load.
Honestly for a basic personal blog this technique probably isn't really necessary. You could just run it through Forever on port 80 with no Nginx and forget it, but if you expect tons of traffic, or if you want high 99% uptime, or if you just want to have some fun configuring a server then the technique I explained above is how you do it. It takes some fiddling to get Nginx configured properly and that tutorial I linked actually leaves out some details of the upstream server configuration but its pretty easy to figure out from the Nginx documentation.
http://blog.argteam.com/coding/hardening-node-js-for-product...
Basically Nginx is used as a reverse proxy to serve requests from a pool of Node.js processes, each with its own internal port. So you would set up the Node.js app to run internally on ports 8080, 8081, 8082, and 8083 for example. (If you have a quad core server this assures that under extreme load each processor can be fully utilized by one single-thread Node.js process). Then Nginx serves requests on port 80 by fetching the response from one of those four internal ports in round robbin fashion.
If one of the processes crashes due to a bug or you want to specifically restart it so that a new code update takes effect in production then Nginx will automatically remove it from the pool while it is down and then add it back when it comes back online. When you are pushing out code updates you can cycle each process one at a time to do a zero downtime deploy.
The other cool thing that you can do with Nginx reverse proxies is use the proxy_cache as a robust cache layer to almost completely remove stress from your blog under high load.
Honestly for a basic personal blog this technique probably isn't really necessary. You could just run it through Forever on port 80 with no Nginx and forget it, but if you expect tons of traffic, or if you want high 99% uptime, or if you just want to have some fun configuring a server then the technique I explained above is how you do it. It takes some fiddling to get Nginx configured properly and that tutorial I linked actually leaves out some details of the upstream server configuration but its pretty easy to figure out from the Nginx documentation.