HAProxy配置文件

HAProxy配置文件

global
    log         127.0.0.1 local2 info
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     20480
    nbproc     8
    user        haproxy
    group       haproxy
    daemon
    stats socket /var/lib/haproxy/stats
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                 3000
    stats refresh 30s
    stats realm Welcome Login Haproxy\ Statistics
    stats uri /haproxy-admin
    stats auth admin:admin~!@
    stats hide-version
    stats admin if TRUE

frontend  Web_Service
    bind *:80
    mode http
    log global
    option httplog
    option forwardfor
    option httpclose
    option logasap
    option dontlognull
    #capture request header Host len 20
    #copture request header Referer len 20
    default_backend             web
backend web
    mode http
    option redispatch
    option abortonclose
    balance source
    cookie SERVERID
    #option httpchk GET /index.html
    server  web1 192.168.199.203:80 cookie server1 weight 1 check inter 2000 rise 2 fall 3
    server  web2 192.168.199.204:80 cookie server2 weight 1 check inter 2000 rise 2 fall 3
posted @   wanghongwei-dev  阅读(49)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
点击右上角即可分享
微信分享提示