diff --git a/doc/management.txt b/doc/management.txt index 5a256a8e7..aacbfab6c 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -1738,6 +1738,13 @@ add backend from [mode ] [guid ] [ EXPERIMENTAL ] in the unpublished state. Once considered ready for traffic, use "publish backend" to expose the newly created instance. + All named default proxies can be used, given that they validate the same + inheritance rules applied during configuration parsing. There is some + exceptions though, for example when the mode is neither TCP nor HTTP. Another + exception is that it is not yet possible to use a default proxies which + reference custom HTTP errors, for example via the errorfiles or http-rules + keywords. + This command is restricted and can only be issued on sockets configured for level "admin". Moreover, this feature is still considered in development so it also requires experimental mode (see "experimental-mode on"). diff --git a/src/proxy.c b/src/proxy.c index eeed469b5..292e72f8d 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -4851,6 +4851,15 @@ static int cli_parse_add_backend(char **args, char *payload, struct appctx *appc cli_dynerr(appctx, memprintf(&msg, "Mode is required as '%s' default proxy does not explicitely defines it.\n", def_name)); return 1; } + if (defpx->mode != PR_MODE_TCP && defpx->mode != PR_MODE_HTTP) { + cli_dynerr(appctx, memprintf(&msg, "Dynamic backends only support TCP or HTTP mode, whereas default proxy '%s' uses 'mode %s'.\n", + def_name, proxy_mode_str(defpx->mode))); + return 1; + } + if (!LIST_ISEMPTY(&defpx->conf.errors)) { + cli_dynerr(appctx, memprintf(&msg, "Dynamic backends cannot inherit from default proxy '%s' because it references HTTP errors.\n", def_name)); + return 1; + } thread_isolate();