Short answer: nginx is faaaar better than node to render static files, but you'll need to recompile it if you use websockets (it cannot proxy ws as is)
we do not use nginx with node but just use node itself as a front facing
proxy using node-http-proxy - we like the idea of less packages but we
haven't really seen it under big time loads yet but don't foresee any
problems. node-http-proxy has some good examples to follow - you can
try this first and see if it meets your needs. You can always fall
back and use Nginx.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
Is now a good time to drop nginx and run node alone? or should I wait?
If now is a good time, then what is the best way to run node on port
80 with non-root privilege?
I see several ways people do this on other web servers:
- run as root, then drop the privilege
- use iptables to redirect the port
Felix Halim
> Is now a good time to drop nginx and run node alone? or should I wait?
I still like using a front end proxy server as it allows you to present a nice error page while you restart your app server (assuming you're only running one server with no load balancing).
> If now is a good time, then what is the best way to run node on port
> 80 with non-root privilege?
>
> I see several ways people do this on other web servers:
> - run as root, then drop the privilege
> - use iptables to redirect the port
If you're using cluster you just tell it the user to run as, and start it as root. It will drop the privileges for you. If you're not using cluster you probably should be :)
Losers wait - winners take action but plan out a risk evaluation. Try
it on something not too critical and then step up. I'm pretty
conservative but at some point you just have to break some ground if you
want to move forward - there are a bunch of people using Node without
another front server and no one has posted that they tried it and it was
not up to par and they had to revert so that's an indication that the
water is pretty safe to step in - please post your experiences to build
the knowledge base.
On Oct 12, 2011 9:14 AM, "Thomas Love" <tom...@gmail.com> wrote:
>
>
> On Oct 12, 9:59 am, Felix Halim <felix.ha...@gmail.com> wrote:
> > I saw one of Ryan Dahl's presentation that when node get matured
> > enough, we won't need nginx.
> >
> > Is now a good time to drop nginx and run node alone? or should I wait?
> >
>
> I'd say it's a good time to drop nginx when you expect a measurable
> benefit to accrue from doing so.
>
> Otherwise what's the point? Premature optimization and all that...
>
> Even if you have a measurable benefit, it should outweigh the costs. I
Oh, let me second that - i misread and did not realize you were already running behind nginx. The golden rule still applies: if it is not broke don't fix it unless you really have to.
But I will disagree with @Thomas - node is a web server, though perhaps with some different features and maybe not as good on some issues (some have posted that nginx serves static files faster but not sure about that) but if those are not critical then .... And the less component interaction => the less complexity, the less maintenance, etc. For us it is one less package to install and configure, and update
So pick a test project and try it out - i suggest you look at node-http-proxy
> think most of the costs are hard to quantify though, and will
> materialize as maintenance and flexibility trouble down the line. For
> this reason I'm personally in favour of maintaining separation of
> function and having each component "doing one thing well". Node might
> be a perfectly good webserver, but that's not its main strength. Nginx
> on the other hand is a brilliant webserver. They complement each other.
>
On Oct 12, 2011 9:14 AM, "Thomas Love" <tom...@gmail.com> wrote:
>
>
> On Oct 12, 9:59 am, Felix Halim <felix.ha...@gmail.com> wrote:
> > I saw one of Ryan Dahl's presentation that when node get matured
> > enough, we won't need nginx.
> >
> > Is now a good time to drop nginx and run node alone? or should I wait?
> >
>
> I'd say it's a good time to drop nginx when you expect a measurable
> benefit to accrue from doing so.
>
> Otherwise what's the point? Premature optimization and all that...
>
> Even if you have a measurable benefit, it should outweigh the costs. IOh, let me second that - i misread and did not realize you were already running behind nginx. The golden rule still applies: if it is not broke don't fix it unless you really have to.
But I will disagree with @Thomas - node is a web server, though perhaps with some different features and maybe not as good on some issues (some have posted that nginx serves static files faster but not sure about that) but if those are not critical then .... And the less component interaction => the less complexity, the less maintenance, etc. For us it is one less package to install and configure, and update
So pick a test project and try it out - i suggest you look at node-http-proxy
> If now is a good time, then what is the best way to run node on port
> 80 with non-root privilege?
>
> I see several ways people do this on other web servers:
> - run as root, then drop the privilege
I was planning to follow this strategy to do that:
http://onteria.wordpress.com/2011/05/31/dropping-privileges-using-process-setuid-in-node-js/