HAProxy community

Explicitly disable stats on TCP-mode


If the defaults block contains stats enable, then there is no way to explicitly disable stats on each TCP-mode listener, and you always get a warning about the config:
[WARNING] 349/011014 (16056) : config : 'stats' statement ignored for proxy 'my-listen-name' as it requires HTTP mode.

This could be worked around by removing stats enable from the defaults and manually adding to EVERY http-mode listen, but that is annoying. Can we get something like stats disable added, that disables the stats on that listen block?


“no stats …” should work.

Also, you may want to use two default sections, on without stats and the other one with stats. Frontends/Backends/Listen section will inherit previous default sections afaik:


blabal default configuration

no stats here

frontend asd

frontend without stats

backend xy

backend without stats

stats enable
frontend abcd

stats enabled


no stats enable does NOT work.

1.7.0 gives this output for it:

[ALERT] 349/165116 (16649) : parsing [haproxy.cfg:36]: negation/default currently supported only for options and log.
[ALERT] 349/165116 (16649) : Error(s) found in configuration file : haproxy.cfg
[WARNING] 349/165116 (16649) : config : 'stats' statement ignored for proxy 'my-tcp-listener' as it requires HTTP mode.
[ALERT] 349/165116 (16649) : Fatal errors found in configuration.

(and it fails)

The multiple default blocks is interesting, but not easy to implement with some configuration management tools.


I submitted a patch to implement stats disable.