linux:haproxy
差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
linux:haproxy [2016/04/17 20:50] – 创建 memory | linux:haproxy [2023/12/03 10:24] (当前版本) – 外部编辑 127.0.0.1 | ||
---|---|---|---|
行 5: | 行 5: | ||
===== Installation ===== | ===== Installation ===== | ||
+ | < | ||
+ | sudo apt-get install haproxy | ||
+ | sudo yum install haproxy | ||
+ | </ | ||
+ | |||
+ | ===== Configuration ===== | ||
+ | |||
+ | 以下以'' | ||
+ | |||
+ | < | ||
+ | global | ||
+ | log | ||
+ | |||
+ | chroot | ||
+ | pidfile | ||
+ | maxconn | ||
+ | user haproxy | ||
+ | daemon | ||
+ | |||
+ | defaults | ||
+ | mode http # 运行在http模式,共有{ tcp, http, health }三种工作模式 | ||
+ | log | ||
+ | option | ||
+ | option | ||
+ | option http-server-close | ||
+ | option forwardfor | ||
+ | option | ||
+ | retries | ||
+ | timeout http-request | ||
+ | timeout queue | ||
+ | timeout connect | ||
+ | timeout client | ||
+ | timeout server | ||
+ | timeout http-keep-alive 10s | ||
+ | timeout check | ||
+ | maxconn | ||
+ | |||
+ | ### | ||
+ | # 下面例子为一个简单的反向代理: | ||
+ | # 基本模式为frontend分流,将请求导往不同的backend处理 | ||
+ | ### | ||
+ | frontend | ||
+ | acl url_static | ||
+ | acl url_static | ||
+ | |||
+ | use_backend static | ||
+ | default_backend | ||
+ | |||
+ | backend static | ||
+ | balance | ||
+ | server | ||
+ | |||
+ | backend app | ||
+ | balance | ||
+ | server | ||
+ | server | ||
+ | server | ||
+ | server | ||
+ | </ | ||
+ | |||
+ | ====== Reference ====== | ||
+ | |||
+ | * [[http:// |
linux/haproxy.1460897429.txt.gz · 最后更改: 2023/12/03 10:24 (外部编辑)