HAProxy的状态页

启用基于程序编译时默认设置的统计报告,不能用于"frontend"区段,只要没有另外的其他设定,他们就会使用如下的配置
stats uri    : /haproxy$stats
stats realm    : "HAProxy Statistics"
stats auth    : no authentication
stats scope    : no restriction
例如:
listen stats
        bind *:9090
        stats enable
        stats hide-version
    如图:
    

尽管"stats enable"一条就能够启用统计报告,但还是建议设定其它所有的参数,以免其依赖于默认设定儿带来的非期后果。
配置案例:
listen  statistics
        bind *:9090
        stats enable
        stats hide-version
        stats scope .
        stats uri /haproxyadmin?stats
        stats realm "Haproxy\ Statistics"
        stats auth fansik:fanjinbao
上面配置如图:


管理员配置:
listen  statistics
        bind *:9090
        stats enable
        stats hide-version
        stats uri /haproxyadmin?stats
        stats realm "Haproxy\ Statistics"
        stats auth admin:fanjinbao
        stats admin if TRUE
显示如图:

posted @ 2017-07-26 17:52  fansik  阅读(569)  评论(0编辑  收藏  举报