简体   繁体   English

NGINX、边缘、HAPRoxy

[英]NGINX, THe Edge, HAPRoxy

I was going through Uber Engineering website where I came across this paragraph and I it confused me a lot, if anyone can make it clear for me then I would be thankful to him/her:我正在浏览优步工程网站,在那里我看到了这一段,我很困惑,如果有人能帮我说清楚,我会感谢他/她:

The Edge The frontline API for our mobile apps consists of over 600 stateless endpoints that join together multiple services.边缘 我们移动应用程序的前线 API 由 600 多个无状态端点组成,这些端点将多个服务连接在一起。 It routes incoming requests from our mobile clients to other APIs or services.它将来自我们移动客户端的传入请求路由到其他 API 或服务。 It's all written in Node.js, except at the edge, where our NGINX front end does SSL termination and some authentication.除了在边缘,我们的 NGINX 前端执行 SSL 终止和一些身份验证之外,所有这些都是用 Node.js 编写的。 The NGINX front end also proxies to our frontline API through an HAProxy load balancer. NGINX 前端还通过 HAProxy 负载均衡器代理我们的前线 API。

This is the link.这是链接。

NGINX is already a reverse proxy + load balancer, then from where HAProxy load balancer came in the picture and where exactly it fits in the picture? NGINX已经是一个反向代理+负载均衡器,那么HAProxy负载均衡器是从哪里来的,又到底是在什么地方呢? What is "the edge" he talked about?他所说的“边缘”是什么? Either the guy who wrote his he wrote confused words or I dont know English.要么写他的人写了混淆的词,要么我不懂英语。

Please help.请帮忙。

It seems like they're using HAProxy strictly as a load balancer, and using NGINX strictly to terminate SSL and for authentication.似乎他们严格使用 HAProxy 作为负载均衡器,并严格使用 NGINX 来终止 SSL 和身份验证。 It isn't necessary in most cases to use HAProxy along with NGINX, as you mentioned, NGINX has load-balancing capabilities, but being Uber, they probably ran into some unique problems that required the use of both.在大多数情况下,没有必要将 HAProxy 与 NGINX 一起使用,正如您提到的,NGINX 具有负载平衡功能,但作为 Uber,他们可能会遇到一些需要同时使用两者的独特问题。 According to the information I've read, such as http://www.loadbalancer.org/blog/nginx-vs-haproxy/ and https://thehftguy.com/2016/10/03/haproxy-vs-nginx-why-you-should-never-use-nginx-for-load-balancing/ , NGINX works extremely well as a web server, including the use case where it is serving as a reverse proxy for a node application, but its load-balancing capabilities are basic and not nearly as performant as HAProxy.根据我阅读的信息,例如http://www.loadbalancer.org/blog/nginx-vs-haproxy/https://thehftguy.com/2016/10/03/haproxy-vs-nginx-为什么你应该永远不要使用 nginx-for-load-balancing/ ,NGINX 作为一个 web 服务器工作得非常好,包括它作为节点应用程序的反向代理的用例,但它的负载平衡功能是基本的,性能不如 HAProxy。 Additionally, HAProxy exposes many more metrics for monitoring, and has more advanced routing capabilities.此外,HAProxy 公开了更多用于监控的指标,并具有更高级的路由功能。

Load balancing is not the core feature of NGINX.负载均衡不是 NGINX 的核心特性。 In the context of a node.js application, usually what you would see NGINX used for is to serve as a reverse proxy, meaning that NGINX is the web server, and http requests come through it.在 node.js 应用程序的上下文中,您通常会看到 NGINX 用作反向代理,这意味着 NGINX 是 Web 服务器,http 请求通过它来。 Then, based on the hostname and other rules, it forwards on the HTTP request to whatever port your node.js application is running on.然后,根据主机名和其他规则,它将 HTTP 请求转发到运行 node.js 应用程序的任何端口。 As part of this flow, often NGINX will handle SSL termination, so that this computationally-intensive task is not being handled by node.js.作为此流程的一部分,NGINX 通常会处理 SSL 终止,因此 node.js 不会处理此计算密集型任务。 Additionally, NGINX is often used to serve static assets for node.js apps, as it is more efficient, especially when compressing assets.此外,NGINX 通常用于为 node.js 应用程序提供静态资产,因为它更高效,尤其是在压缩资产时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM