-
Notifications
You must be signed in to change notification settings - Fork 81
/
20-stats.cfg
42 lines (39 loc) · 1.4 KB
/
20-stats.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2017-12-16 09:14:31 +0000 (Sat, 16 Dec 2017)
#
# https://github.com/HariSekhon/HAProxy-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# H A P r o x y S t a t s
# ============================================================================ #
userlist stats-auth
group admin users admin
group readonly users haproxy
user admin insecure-password test
user haproxy insecure-password test
listen stats
bind *:1936
mode http
option httplog
stats enable
acl internal_networks src 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 127.0.0.1
stats http-request deny unless internal_networks
stats uri / # default: /haproxy?stats
stats hide-version
stats show-legends
stats show-node
# simple user - allow admin if localhost
#stats auth haproxyuser:haproxypw
#stats admin if LOCALHOST # pre-defined acl -> src 127.0.0.1/8
acl AUTH http_auth(stats-auth)
acl AUTH_ADMIN http_auth_group(stats-auth) admin
stats http-request auth unless AUTH
stats admin if AUTH_ADMIN