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供参考
# Simple configuration for an HTTP proxy listening on port 80 on all
# interfaces and forwarding requests to a single backend "servers" with a
# single server "server1" listening on 127.0.0.1:8000
global
daemon
maxconn 256 defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms frontend http-in
bind *:80
default_backend servers backend servers
server server1 127.0.0.1:8000 maxconn 32 # The same configuration defined with a single listen block. Shorter but
# less expressive, especially in HTTP mode.
global
daemon
maxconn 256 defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms listen http-in
bind *:80
server server1 127.0.0.1:8000 maxconn 32

HAProxy 基本翻译的更多相关文章

  1. 理解 OpenStack Swift (1):OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置

    本系列文章着重学习和研究OpenStack Swift,包括环境搭建.原理.架构.监控和性能等. (1)OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置 ( ...

  2. HAProxy的三种不同类型配置方案

    haproxy是一款功能强大.灵活好用反向代理软件,提供了高可用.负载均衡.后端服务器代理的功能,它在7层负载均衡方面的功能很强大(支持 cookie track, header rewrite等等) ...

  3. HAProxy的独门武器:ebtree

    1. HAProxy和ebtree简介 HAProxy是法国人Willy Tarreau个人开发的一个开源软件,目标是应对客户端10000以上的同时连接,为后端应用服务器.数据库服务器提供高性能的负载 ...

  4. lVS/haproxy

    haproxy 安装配置   1. 下载及安装 wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.21.tar.gz tar zxvf h ...

  5. 负载均衡服务之HAProxy基础入门

    首先我们来了解下haproxy是干嘛的?haproxy是一个法国人名叫Willy Tarreau开发的一个开源软件:这款软件主要用于解决客户端10000以上的同时连接的高性能的TCP和HTTP负载均衡 ...

  6. 负载均衡服务之HAProxy访问控制ACL

    前文我们聊到了haproxy的错误页的配置,自定义日志的配置,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/12797913.html:今天我们主要来看看hap ...

  7. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  8. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  9. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

随机推荐

  1. osg学习笔记3 简单几何模型

    osg::Geode (geometry node) osg::Geode类表示场景中的渲染几何叶节点,它包含了渲染用的几何信息,没有子节点. 要绘制的几何数据保存在osg::Geode管理的一组os ...

  2. Protel DXP画原理图常见错误与警告

    一.警告信息 警告信息对于将来转换成PCB不会造成严重问题,通常可以忽略.但它也给我们提供了一些参考,比如unconnceted pin能告诉我们芯片的哪些管脚没有连接,很有检错意义. 1.has n ...

  3. String 类型的相关转换

    题目: what is the result of the expression 5.4+"3.2"? 答案: 当一个运算数为原始数据类型,另外一个为字符串时,则基本数据类型会转化 ...

  4. 【UVA 10600】 ACM Contest and Blackout(最小生成树和次小生成树)

    [题意] n个点,m条边,求最小生成树的值和次小生成树的值. InputThe Input starts with the number of test cases, T (1 < T < ...

  5. VC判断当前用户有无Administrator的权限(用EqualSid API函数判断与Admin是否在一个组的Sid)

    /************************************************************************/ /* 函数说明:判断有无Administrator ...

  6. 《鸟哥的Linux私房菜》读书笔记一

    1.CPU为一个具有特定功能的芯片,里面含有微指令集,一个CPU又可以分为两个主要的单元:算术逻辑单元和控制单元.CPU读取的数据都是从内存读取来的,内存内的数据是从输入单元传输来的.CPU处理完也要 ...

  7. Navigation Drawer介绍

    在2013 google IO当天,Android团的更新了Support库,新版本(V13)的Support库中新加入了几个比较重要的功能. 添加 DrawerLayout 控件,支持创建  Nav ...

  8. 例说C#深拷贝与浅拷贝

    一开始,先对C#深拷贝与浅拷贝知识做个简单的总结. 无论是浅拷贝与深拷贝,C#都将源对象中的所有字段复制到新的对象中.不过,对于值类型字段,引用类型字段以及字符串类型字段的处理,两种拷贝方式存在一定的 ...

  9. logstahs 匹配isslog

    2016-11-30 06:33:33 192.168.5.116 GET /Hotel/HotelDisplay/cncqcqb230 - 80 - 192.168.9.2 Mozilla/5.0+ ...

  10. android-86-Can't create handler inside thread that has not called Looper.prepare()

    以下是Android API中的一个典型的Looper thread实现: //Handler不带参数的默认构造函数:new Handler(),实际上是通过Looper.myLooper()来获取当 ...