Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>"is a web-server necessary"?</p> <p>Technically, no. Practically, yes a separate web server is typically used and for good reason.</p> <p>In <a href="http://www.yuiblog.com/blog/2010/05/20/video-dahl/" rel="noreferrer">this talk by Ryan Dahl in May 2010</a>, at 37'30" he states that he recommends running node.js behind a reverse proxy or web server for "security reasons". To elaborate on that, hardened web servers like nginx or apache have had their TCP stacks evolve for a long time in terms of stability and security. Node.js is not at that same level yet. Thus, since putting node.js behind nginx is easy, doesn't have many negative consequences, and in theory increases the security of your deployment somewhat, it is a good choice. At some point in time, node.js may be deemed officially "ready for live direct Internet connections" but wait for Ryan/Joyent to make some announcement to that effect.</p> <p>Secondly, binding to sub-1024 ports (like 80 and 443) requires the process to be root. nginx and others automatically handle binding as root and then dropping privileges to a safer user account (www-data or nobody typically). Although node.js has system call wrappers in the <code>process</code> module to drop root privileges with <code>setgid</code> and <code>setuid</code>, AFAIK other than coding this yourself the node community hasn't yet seen a convention emerge for doing this. More on this topic in <a href="http://comments.gmane.org/gmane.comp.lang.javascript.nodejs/8959" rel="noreferrer">this discussion</a>.</p> <p>Thirdly, web servers are good at virtual hosting and in general there are convenient things you can do (URL rewriting and such) that require custom coding in node.js to achieve otherwise.</p> <p>Fourthly, nginx is great at serving static files. Better than node.js (at least by a little as of right now). Again as time goes forward this point may become less and less relevant, but in my mind a traditional static file web server and a web application server still have distinct roles and purposes.</p> <p>"If yes, which one and why"?</p> <p><a href="http://nginx.org/" rel="noreferrer">nginx</a>. Because it has great performance and is simpler to configure than apache.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload