博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
haproxy http实例配置
阅读量:6435 次
发布时间:2019-06-23

本文共 1611 字,大约阅读时间需要 5 分钟。

---------------------------------------------------------------------

Global settings

code by

---------------------------------------------------------------------

global

# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 30000
listen stats
mode http
bind 0.0.0.0:1080
stats enable
stats hide-version
stats uri /haproxyadmin?stats
stats realm Haproxy\ Statistics
stats auth admin:admin
stats admin if TRUE
frontend http-in
bind *:80
mode http
log global
option httpclose
option logasap
option dontlognull
capture request header Host len 20
capture request header Referer len 60
default_backend servers
frontend healthcheck
bind :1099
mode http
option httpclose
option forwardfor
default_backend servers
backend servers
balance roundrobin
server websrv1 192.168.10.11:80 check maxconn 2000
server websrv2 192.168.10.12:80 check maxconn 2000

转载地址:http://ehhga.baihongyu.com/

你可能感兴趣的文章
使用List的remove方法需要的注意的问题
查看>>
Ansible的介绍、安装、配置及常用模块介绍
查看>>
编码列表
查看>>
eigrp 配置
查看>>
谈一谈 redis 集群
查看>>
concurrent包
查看>>
在Linux下调试Python代码的各种方法
查看>>
centos7塔建MQ服务器
查看>>
Peer authentication failed for user
查看>>
超强的.NET图像工具包VintaSoftImaging.NET SDK更新至v8.6丨75折优惠
查看>>
阿里云上Kubernetes集群联邦
查看>>
洛谷2219:[HAOI2007]修筑绿化带——题解
查看>>
监控webservice信息
查看>>
a标签中href=""的几种用法(转)
查看>>
python
查看>>
ubuntu 常用生产环境部署配置测试调优
查看>>
【JS】//将中文逗号转换为英文逗号
查看>>
在VS2012中实现Ext JS的智能提示太简单了
查看>>
Extnet Direct 提交后台事件文件下载设置
查看>>
邻接矩阵与二叉排序树
查看>>