From fb25d63b21e05d763140c413f75260454226369a Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Wed, 12 Feb 2025 14:07:13 +0100 Subject: [PATCH] moved the stats bit in clause true or false --- templates/haproxy_head.erb | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/templates/haproxy_head.erb b/templates/haproxy_head.erb index bab56bf..844dbd8 100644 --- a/templates/haproxy_head.erb +++ b/templates/haproxy_head.erb @@ -17,8 +17,15 @@ global daemon <% if @hy_show_stats == true -%> - # turn on stats unix socket - stats socket /var/lib/haproxy/stats +listen stats + bind 127.0.0.1:8404 # Bind to localhost if only local access is needed + mode http + stats enable + stats uri /haproxy?stats + stats realm Strictly\ Private + stats auth local_admin:jSAVu62MV+kr+>R. # Use a strong password + stats refresh 30s + stats admin if TRUE # Allow admin actions if logged in <% end -%> # utilize system-wide crypto-policies @@ -56,15 +63,5 @@ defaults timeout check <%= @hy_timeout_check %> maxconn <%= @hy_maxconn %> -listen stats - bind 127.0.0.1:8404 # Bind to localhost if only local access is needed - mode http - stats enable - stats uri /haproxy?stats - stats realm Strictly\ Private - stats auth local_admin:jSAVu62MV+kr+>R. # Use a strong password - stats refresh 30s - stats admin if TRUE # Allow admin actions if logged in - ### custom rules below ###