为什么要安装服务器(Nginx的,Apache的...)用Node.js的? [英] Why install server (Nginx, Apache...) with Node.js?

查看:131
本文介绍了为什么要安装服务器(Nginx的,Apache的...)用Node.js的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/9287747/why-do-we-need-apache-under-node-js-ex$p$pss-web-framework\">Why我们需要的Node.js前preSS Web框架下的Apache?

我不知道我为什么要安装服务器,如Nginx的或Apache使用Node.js的我曾经以为,服务器可以帮我处理高速缓存控制或更多的东西。但我发现,在连接静态中间件已经这样做了,对吧?

I wonder why I should install a server such as Nginx or Apache with Node.js. I used to think that the server can help me to handle cache control or something more. But I found out that the Connect static middleware already does it, right?

推荐答案

如果你不知道你为什么需要Nginx的或Apache上的Node.js之上,那么你不需要它。

If you don't know why you need Nginx or Apache on top of Node.js, then you don't need it.

Nginx的做了几件事情快(在某些情况下更容易配置),比Node.js的:代理,URL重写HTTP缓存,重定向,静态文件服务和负载平衡

Nginx does a few things faster (and in some cases easier to configure) than Node.js: proxying, url rewriting, http caching, redirection, static file serving, and load balancing.

如果您在遇到你的Node.js code任何这些角色的成长是复杂的,或变成是性能瓶颈,这是值得探讨。在此之前,没有必​​要多此一举。

If you experience that your Node.js code for any of these roles are growing complex, or turn out to be performance bottlenecks, it's worth investigating. Until then, no need to bother.

这篇关于为什么要安装服务器(Nginx的,Apache的...)用Node.js的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆