From: Willy Tarreau Date: Mon, 13 Feb 2012 13:32:34 +0000 (+0100) Subject: MINOR: config: emit a warning when 'default_backend' masks servers X-Git-Tag: v1.5-dev8~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff67813f58ad7d8e94a5e3ac8859b161b10fb815;p=thirdparty%2Fhaproxy.git MINOR: config: emit a warning when 'default_backend' masks servers When a "listen" instance uses a "default_backned" rule and has servers, the servers will never be used. Report it so that users don't get trapped. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 815ffff7fa..77f0c5d81d 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -5723,6 +5723,13 @@ int check_config_validity() */ target->bind_proc = curproxy->bind_proc ? (target->bind_proc | curproxy->bind_proc) : 0; + + /* Emit a warning if this proxy also has some servers */ + if (curproxy->srv) { + Warning("In proxy '%s', the 'default_backend' rule always has precedence over the servers, which will never be used.\n", + curproxy->id); + err_code |= ERR_WARN; + } } }