为什么我们需要Node.js的前preSS Web框架下的Apache? [英] Why do we need apache under Node.js express web framework?

查看:145
本文介绍了为什么我们需要Node.js的前preSS Web框架下的Apache?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要部署我的Node.js应用程序。

I am going to deploy my node.js application.

只有纯粹的node.js我可以开始我自己的Web应用程序。

I can start my own web application with purely node.js only.

但我的FD告诉我,这是更好地为下Apache或Nginx的是Web应用程序。

But my fd told me that it is better to serve that web app under apache or nginx.

任何人有过类似的经验,为什么我们需要Apache作为我可以node.js的开始我的web应用程序+ EX preSS只?

Anyone have such kind of experience, why do we need apache as I can start my web app on node.js+ express only?

我想更多的了解有关部署知识。感谢您的帮助。

I would like to know more on deployment knowledges. Thanks for any help.

套件

推荐答案

在节点之前把Apache是​​不是在一个新建的应用典型。我可以授予此的唯一情况是,如果你的公司有在基于Apache基础设施的前端和系统管理员的现有投资(监控/安全性/路由/缓存等)坚持此设置。

Putting Apache in front of Node is not typical in a greenfield app. The only case I can grant to this is if your company has an existing investment in an Apache based infrastructure (monitoring/security/routing/caching etc..) on the frontend and the sysadmin insist on this setup.

这Node.js的路程有些人preFER把nginx的或HAProxy的前面来管理路由规则,这样他们就可以引导对静态文件(资产)的请求(node.js的处理静态文件的时候并不总是高性能),或做花哨的负载平衡或故障转移。在0.2.X等初期......即使瑞恩·达尔主张中运行的Node.js的面前的东西安全为主;虽然,我不认为任何显著的问题被发现。我亲自跑在nginx的Node.js的前面,因为我们有几个网站和服务,打前端共享的IP,我们的代理回各节点实例监听不同的内部端口。

Some folks prefer to put nginx or haproxy in front to manage routing rules, so they can channel requests for static files (assets) away from Node.js (node.js wasn't always performant when handling static files), or do fancy load balancing or failover. In the early days of 0.2.x etc... even Ryan Dahl advocated running something in front of Node.js for security mainly; although, I don't think any significant issues were discovered. I personally run nginx in front of Node.js as we have several sites and services that hit the frontend shared IP which we proxy back to various node instances listening on different internal ports.

Nginx的更适合比Apache,因为它重量轻,单线程VS Apache的线程每个请求(在大多数正常设置)。但现在甚至有一个可靠的(节点HTTP代理除外)前端Node.js的基于代理 HTTP:// WWW其中的名人之一的Node.js开发.github.com / substack /充气使用/将使用到前端的PaaS他

Nginx is better suited than Apache as it is light and single threaded vs Apache thread per request (in most normal setups). But nowadays there's even a reliable (node-http-proxy excluded) frontend Node.JS based proxy http://www.github.com/substack/bouncy which one of the celebrity node.js developers uses/will-use to frontend his PaaS.

这篇关于为什么我们需要Node.js的前preSS Web框架下的Apache?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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