HAProxy 基本翻译

REF:http://cbonte.github.io/haproxy-dconv/1.5/configuration.html

Proxy configuration can be located in a set of sections : - defaults <name> - frontend <name> - backend <name> - listen <name> A "defaults" section sets default parameters for all other sections following its declaration. Those default parameters are reset by the next "defaults" section. See below for the list of parameters which can be set in a "defaults" section. The name is optional but its use is encouraged for better readability.
"defaults" 区块设置默认参数,对其定义后的所有区块有效。所有默认参数在优先级上,会被后面的
“defaults”区块覆盖。"defaults"区块可设置参数清单见下文。“name”不是必须的,但为了有较好的可读性
建议写上。
A "frontend" section describes a set of listening sockets accepting client connections.
“frontend”区块描述接受客户端连接的监听sockets集。 A "backend" section describes a set of servers to which the proxy will connect to forward incoming connections.
“backend”区块描述代理服务器集,代理将连接并转发入栈信息给这些服务器。 A "listen" section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.
“listen”区块定义了完整的代理,将“frontend”和“backend”结合在一个区块中。一般用在TCP-only
流量中。
All proxy names must be formed from upper and lower case letters, digits, '-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are case-sensitive, which means that "www" and "WWW" are two different proxies.
所有的代理名称必须由大小写字符、数字、'-'、'_'、'.'和':'构成。ACL名对大小写敏感,这
意味着"www"和“WWW”代表不同的代理。
Historically, all proxy names could overlap, it just caused troubles in the logs. Since the introduction of content switching, it is mandatory that two proxies with overlapping capabilities (frontend/backend) have different names. However, it is still permitted that a frontend and a backend share the same name, as this configuration seems to be commonly encountered.
Right now, two major proxy modes are supported : "tcp", also known as layer 4, and "http", also known as layer 7. In layer 4 mode, HAProxy simply forwards bidirectional traffic between two sides. In layer 7 mode, HAProxy analyzes the protocol, and can interact with it by allowing, blocking, switching, adding, modifying, or removing arbitrary contents in requests or responses, based on arbitrary criteria. 目前,HAProxy支持两种主要的模式:“tcp”(4层)和“http”(7层)。在4层模式,HAProxy只是
简单的转发双向流量。在7层模式,HAProxy分析协议,并根据任意条件对请求和响应内容进行允许、阻断、
交换和增删改。
In HTTP mode, the processing applied to requests and responses flowing over a connection depends in the combination of the frontend's HTTP options and the backend's. HAProxy supports 5 connection modes :
在HTTP模式下,对请求和响应的处理由前端的HTTP option和后端配合决定。HAProxy支持五种
连接模式。
- KAL : keep alive ("option http-keep-alive") which is the default mode : all requests and responses are processed, and connections remain open but idle between responses and new requests. - TUN: tunnel ("option http-tunnel") : this was the default mode for versions 1.0 to 1.5-dev21 : only the first request and response are processed, and everything else is forwarded with no analysis at all. This mode should not be used as it creates lots of trouble with logging and HTTP processing. - PCL: passive close ("option httpclose") : exactly the same as tunnel mode, but with "Connection: close" appended in both directions to try to make both ends close after the first request/response exchange. - SCL: server close ("option http-server-close") : the server-facing connection is closed after the end of the response is received, but the client-facing connection remains open. - FCL: forced close ("option forceclose") : the connection is actively closed after the end of the response. The effective mode that will be applied to a connection passing through a frontend and a backend can be determined by both proxy modes according to the following matrix, but in short, the modes are symmetric, keep-alive is the weakest option and force close is the strongest. Backend mode | KAL | TUN | PCL | SCL | FCL ----+-----+-----+-----+-----+---- KAL | KAL | TUN | PCL | SCL | FCL ----+-----+-----+-----+-----+---- TUN | TUN | TUN | PCL | SCL | FCL Frontend ----+-----+-----+-----+-----+---- mode PCL | PCL | PCL | PCL | FCL | FCL ----+-----+-----+-----+-----+---- SCL | SCL | SCL | FCL | SCL | FCL ----+-----+-----+-----+-----+---- FCL | FCL | FCL | FCL | FCL | FCL

最后附上一段配置文件example供参考

 

posted @   handt  阅读(1293)  评论(0编辑  收藏  举报
编辑推荐:
· ASP.NET Core 模型验证消息的本地化新姿势
· 对象命名为何需要避免'-er'和'-or'后缀
· SQL Server如何跟踪自动统计信息更新?
· AI与.NET技术实操系列:使用Catalyst进行自然语言处理
· 分享一个我遇到过的“量子力学”级别的BUG。
阅读排行:
· 为什么AI教师难以实现
· 如何让低于1B参数的小型语言模型实现 100% 的准确率
· AI Agent爆火后,MCP协议为什么如此重要!
· 【译】Visual Studio(v17.13)中新的调试和分析特性
· Draw.io:你可能不知道的「白嫖级」图表绘制神器
点击右上角即可分享
微信分享提示