Skip to content

Commit 067be38

Browse files
committed
MAJOR: cfgparse: turn the same proxy name warning to an error
As warned since 3.1, it's no longer permitted to have a frontend and a backend under the same name. This causes too many designation issues, and causes trouble with stick-tables as well. Now each proxy name is unique. This commit only changes the check to return an error. Some code parts currently exist to find the best candidates, these will be able to be simplified as future cleanup patches. The doc was updated.
1 parent 74b9592 commit 067be38

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎doc/configuration.txt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5345,11 +5345,11 @@ All proxy names must be formed from upper and lower case letters, digits,
53455345
'-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
53465346
case-sensitive, which means that "www" and "WWW" are two different proxies.
53475347

5348-
Historically, all proxy names could overlap, it just caused troubles in the
5349-
logs. Since the introduction of content switching, it is mandatory that two
5350-
proxies with overlapping capabilities (frontend/backend) have different names.
5351-
However, it is still permitted that a frontend and a backend share the same
5352-
name, as this configuration seems to be commonly encountered.
5348+
Historically, all proxy names could overlap when certain conditions were met
5349+
(e.g. when not having the same frontend/backend capabilities), but it used to
5350+
cause too many problems in the logs as well as confusion on CLI operations,
5351+
stick-tables naming and stats retrieval. It is now mandatory that two proxies
5352+
have different names, regardless of their respective capabilities.
53535353

53545354
Right now, two major proxy modes are supported : "tcp", also known as layer 4,
53555355
and "http", also known as layer 7. In layer 4 mode, HAProxy simply forwards

‎src/cfgparse-listen.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
424424

425425
if (curproxy) {
426426
/* different capabilities but still same name: forbidden soon */
427-
ha_warning("Parsing [%s:%d]: %s '%s' has the same name as %s '%s' declared at %s:%d."
428-
" This is dangerous and will not be supported anymore in version 3.3.\n",
427+
ha_alert("Parsing [%s:%d]: %s '%s' has the same name as %s '%s' declared at %s:%d."
428+
" This is no longer supported as of 3.3. Please rename one or the other.\n",
429429
file, linenum, proxy_cap_str(rc), args[1], proxy_type_str(curproxy),
430430
curproxy->id, curproxy->conf.file, curproxy->conf.line);
431-
err_code |= ERR_WARN;
431+
err_code |= ERR_ALERT | ERR_ABORT;
432+
goto out;
432433
}
433434

434435
if (rc & PR_CAP_DEF && strcmp(args[1], "from") == 0 && *args[2] && !*args[3]) {

0 commit comments

Comments
 (0)