</usage>
</directivesynopsis>
+<directivesynopsis>
+ <name>ProxyPassInherit</name>
+ <description>Inherit ProxyPass directives defined from the main server</description>
+ <syntax>ProxyPassInherit On|Off</syntax>
+ <default>ProxyPassInherit On</default>
+ <contextlist><context>server config</context><context>virtual host</context></contextlist>
+ <compatibility>ProxyPassInherit is only available in Apache HTTP Server 2.5.0 and later.
+ and later.</compatibility>
+ <usage>
+ <p>This directive will cause the current server/vhost to "inherit"
+ <directive module="mod_proxy">ProxyPass</directive>
+ directives defined in the main server. This can cause issues and
+ inconsistent behavior if using the Balancer Manager for dynamic changes
+ and so should be disabled if using that feature.</p>
+ <p>The setting in the global server defines the default for all vhosts.</p>
+ <p>Disabling ProxyPassInherit also disables <directive module="mod_proxy">BalancerInherit</directive>.</p>
+ </usage>
+</directivesynopsis>
+
<directivesynopsis>
<name>BalancerInherit</name>
- <description>Inherit ProxyPassed Balancers/Workers from the main server</description>
+ <description>Inherit proxy Balancers/Workers defined from the main server</description>
<syntax>BalancerInherit On|Off</syntax>
<default>BalancerInherit On</default>
<contextlist><context>server config</context><context>virtual host</context></contextlist>
<compatibility>BalancerInherit is only available in Apache HTTP Server 2.4.4 and later.
and later.</compatibility>
<usage>
- <p>This directive will cause the current server/vhost to "inherit" ProxyPass
+ <p>This directive will cause the current server/vhost to "inherit"
Balancers and Workers defined in the main server. This can cause issues and
- inconsistent behavior if using the Balancer Manager and so should be disabled
- if using that feature.</p>
+ inconsistent behavior if using the Balancer Manager for dynamic changes
+ and so should be disabled if using that feature.</p>
<p>The setting in the global server defines the default for all vhosts.</p>
+ <p>Disabling <directive module="mod_proxy">ProxyPassInherit</directive> also disables BalancerInherit.</p>
</usage>
</directivesynopsis>
ps->bal_persist = 0;
ps->inherit = 1;
ps->inherit_set = 0;
+ ps->ppinherit = 1;
+ ps->ppinherit_set = 0;
ps->bgrowth = 5;
ps->bgrowth_set = 0;
ps->req_set = 0;
ps->inherit = (overrides->inherit_set == 0) ? base->inherit : overrides->inherit;
ps->inherit_set = overrides->inherit_set || base->inherit_set;
- ps->proxies = apr_array_append(p, base->proxies, overrides->proxies);
+ ps->ppinherit = (overrides->ppinherit_set == 0) ? base->ppinherit : overrides->ppinherit;
+ ps->ppinherit_set = overrides->ppinherit_set || base->ppinherit_set;
+
+ if (ps->ppinherit) {
+ ps->proxies = apr_array_append(p, base->proxies, overrides->proxies);
+ }
+ else {
+ ps->proxies = overrides->proxies;
+ }
ps->sec_proxy = apr_array_append(p, base->sec_proxy, overrides->sec_proxy);
ps->aliases = apr_array_append(p, base->aliases, overrides->aliases);
ps->noproxies = apr_array_append(p, base->noproxies, overrides->noproxies);
ps->dirconn = apr_array_append(p, base->dirconn, overrides->dirconn);
- if (ps->inherit) {
+ if (ps->inherit && ps->ppinherit) {
ps->workers = apr_array_append(p, base->workers, overrides->workers);
ps->balancers = apr_array_append(p, base->balancers, overrides->balancers);
}
return NULL;
}
+static const char *set_ppinherit(cmd_parms *parms, void *dummy, int flag)
+{
+ proxy_server_conf *psf =
+ ap_get_module_config(parms->server->module_config, &proxy_module);
+
+ psf->ppinherit = flag;
+ psf->ppinherit_set = 1;
+ return NULL;
+}
+
static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg)
{
server_rec *s = cmd->server;
AP_INIT_FLAG("BalancerPersist", set_persist, NULL, RSRC_CONF,
"on if the balancer should persist changes on reboot/restart made via the Balancer Manager"),
AP_INIT_FLAG("BalancerInherit", set_inherit, NULL, RSRC_CONF,
- "on if this server should inherit ProxyPassed balancers and workers defined in the main server "
- "(Not recommended if using the Balancer Manager)"),
+ "on if this server should inherit Balancers and Workers defined in the main server "
+ "(Not recommended if using the Balancer Manager for dynamic changes)"),
+ AP_INIT_FLAG("ProxyPassInherit", set_ppinherit, NULL, RSRC_CONF,
+ "on if this server should inherit all ProxyPass directives defined in the main server "
+ "(Not recommended if using the Balancer Manager for dynamic changes)"),
AP_INIT_TAKE1("ProxyStatus", set_status_opt, NULL, RSRC_CONF,
"Configure Status: proxy status to one of: on | off | full"),
AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,