HAProxy提供高可用性、负载均衡以及基于TCP和HTTP应用的代理配置
2013-07-23 20:27
691 查看
global
log 127.0.0.1 local3 # 日志服务器
maxconn 4096 # 单个进程的最大并发数
user nobody # 用户身份
group nobody # 组身份
daemon # 守护进程后台运行
nbproc 1 # 工作进程数量
defaults
log global # 记录日志
mode http # 工作模式 http layer7
option httplog
option dontlognull # 记录空连接日志
retries 3
option redispatch # 强制转换健康服务器
maxconn 2000 # 最大连接数
stats uri /stats
option forwardfor # 后端服务器用forwardfor获取用户IP
contimeout 5000 # 连接超时 毫秒
clitimeout 50000 # 客户端超时
srvtimeout 50000 # 服务器超时
# qiantai
frontend httpd-in
bind 0.0.0.0:80
mode http
log global
option httplog
option httpclose
option forwardfor
#logs
capture request header Host len 20
capture request header User-Agent len 16
capture request header Content-Length len 10
capture request header Referer len 20
capture response header Content-Length len 10
#acl ctrol
acl api_php url_reg -i \.php$
acl api_html url_reg -i \.html$
use_backend php-server if api_php
use_backend html-server if api_html
default_backend html-server
#backend php
backend php-server
mode http
balance roundrobin
server web1 192.168.122.11:80 weight 3 check
server web2 192.168.122.12:80 weight 2 check
option httpchk GET /index.html
#backend html
backend html-server
mode http
balance roundrobin
server web3 192.168.122.15:80 weight 3 check
server web4 192.168.122.16:80 weight 4 check
option httpchk GET /index.php
#listen web 0.0.0.0:80
# mode http
# balance roundrobin # 负载均衡的方式
# cookie SERVERID indirect nocache # 客户端的cookie信息
# option httpclose # 打开支持主动关闭功能
# option forwardfor
# option httpchk HEAD /index.html HTTP/1.0 # 健康检查
# server server1 192.168.122.11:80 cookie 1 check inter 2000 rise 2 fall 5
# server server2 192.168.122.12:80 cookie 2 check inter 2000 rise 2 fall 5
#
log 127.0.0.1 local3 # 日志服务器
maxconn 4096 # 单个进程的最大并发数
user nobody # 用户身份
group nobody # 组身份
daemon # 守护进程后台运行
nbproc 1 # 工作进程数量
defaults
log global # 记录日志
mode http # 工作模式 http layer7
option httplog
option dontlognull # 记录空连接日志
retries 3
option redispatch # 强制转换健康服务器
maxconn 2000 # 最大连接数
stats uri /stats
option forwardfor # 后端服务器用forwardfor获取用户IP
contimeout 5000 # 连接超时 毫秒
clitimeout 50000 # 客户端超时
srvtimeout 50000 # 服务器超时
# qiantai
frontend httpd-in
bind 0.0.0.0:80
mode http
log global
option httplog
option httpclose
option forwardfor
#logs
capture request header Host len 20
capture request header User-Agent len 16
capture request header Content-Length len 10
capture request header Referer len 20
capture response header Content-Length len 10
#acl ctrol
acl api_php url_reg -i \.php$
acl api_html url_reg -i \.html$
use_backend php-server if api_php
use_backend html-server if api_html
default_backend html-server
#backend php
backend php-server
mode http
balance roundrobin
server web1 192.168.122.11:80 weight 3 check
server web2 192.168.122.12:80 weight 2 check
option httpchk GET /index.html
#backend html
backend html-server
mode http
balance roundrobin
server web3 192.168.122.15:80 weight 3 check
server web4 192.168.122.16:80 weight 4 check
option httpchk GET /index.php
#listen web 0.0.0.0:80
# mode http
# balance roundrobin # 负载均衡的方式
# cookie SERVERID indirect nocache # 客户端的cookie信息
# option httpclose # 打开支持主动关闭功能
# option forwardfor
# option httpchk HEAD /index.html HTTP/1.0 # 健康检查
# server server1 192.168.122.11:80 cookie 1 check inter 2000 rise 2 fall 5
# server server2 192.168.122.12:80 cookie 2 check inter 2000 rise 2 fall 5
#
相关文章推荐
- Nginx服务器安装,高性能的HTTP、TCP、反向代理、负载均衡等服务和配置
- haproxy配置tcp负载均衡
- Nginx反向代理Tomcat实现现负载均衡(高可用)以及利用redis+Session同步会话共享配置详解
- haproxy配置基于ssl证书的https负载均衡
- haproxy 提供高可用性、负载均衡
- tomcat基础应用配置以及apache和nginx方向代理的配置
- 如何在Linux上使用HAProxy配置HTTP负载均衡系统
- Linux系统下使用HAProxy配置HTTP负载均衡系统的方法
- 烂泥:高负载均衡学习haproxy之TCP应用
- Haproxy配置http模式负载均衡
- 利用Haproxy实现http和TCP反向代理和负载均衡(入门和技术验证)
- 如何在Linux上使用HAProxy配置HTTP负载均衡系统?
- Nginx之代理配置以及负载均衡
- 基于域名负载均衡的Haproxy配置
- 基于所提供的凭据,您没有权限查看此目录或网页;HTTP 错误 401.2 - 未授权:服务器配置导致登录失败
- haproxy配置基于ssl证书的https负载均衡
- 移动网络应用开发中,使用 HTTP 协议比起使用 socket 实现基于 TCP 的自定义协议有哪些优势?
- 移动网络应用开发中,使用 HTTP 协议比起使用 socket 实现基于 TCP 的自定义协议有哪些优势?
- 支持并发的http客户端(基于tcp连接池以及netty)
- 工作日志:centos6.5下配置Nginx以轮询方式HTTP+TCP负载均衡