I am working on a project where I have successfully implemented an HAProxy stats page that requires a password for access. I have achieved this by reading the password from a file, and the stats page is functioning as expected. However, I am now faced with the challenge of ensuring that there is an effective restriction to the stats page mechanism when the password is changed in the file. The password file is located in the same directory of haproxy.
this is my code for listening haproxy stats
listen stats
bind *:80
stats enable
stats hide-version
stats uri /haproxy?stats
stats refresh 1s
stats auth admin:{{ haproxy_password }}