Use proxy_check_http_errors() on defaults proxy instances. This will
emit alert messages for errorfiles directives referencing a non-existing
http-errors section, or a warning if an explicitely listed status code
is not present in the target section.
This is a small behavior changes, as previouly this was only performed
for regular proxies. Thus, errorfile/errorfiles directives in an unused
defaults were never checked.
This may prevent startup of haproxy with a configuration file previously
considered as valid. However, this change is considered as necessary to
be able to use http-errors with dynamic backends. Any invalid defaults
will be detected on startup, rather than having to discover it at
runtime via "add backend" invokation.
Thus, any restriction on http-errors usage is now lifted for the
creation of dynamic backends.
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.
+ exceptions though, for example when the mode is neither TCP nor HTTP.
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
#include <haproxy/global.h>
#include <haproxy/http_ana.h>
#include <haproxy/http_rules.h>
+#include <haproxy/http_htx.h>
#include <haproxy/lb_chash.h>
#include <haproxy/lb_fas.h>
#include <haproxy/lb_fwlc.h>
else {
cfgerr += acl_find_targets(defpx);
}
+
+ err_code |= proxy_check_http_errors(defpx);
}
/* starting to initialize the main proxies list */
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();