Bug 58120 - ProxyPassInherit does not work as expect
Summary: ProxyPassInherit does not work as expect
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.4-HEAD
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-10 06:26 UTC by silencer018
Modified: 2015-08-03 03:21 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description silencer018 2015-07-10 06:26:34 UTC
http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassinherit

It says the directive will cause the current server/vhost to "inherit" ProxyPass directives defined in the main server. My testing results show that no matter I 
set ProxyPassInherit On or ProxyPassInherit Off, the virtual host always inherits the ProxyPass defined in the main server.

I checked the code, it seems when ProxyPassInherit is set to Off , HTTP server does not merge the config of ProxyRemote(ps->proxies) from global, not the 
ProxyPass(ps->aliases) as I thought.

static void * merge_proxy_config(apr_pool_t *p, void *basev, void *overridesv)
{
    proxy_server_conf *ps = apr_pcalloc(p, sizeof(proxy_server_conf));
    proxy_server_conf *base = (proxy_server_conf *) basev;
    proxy_server_conf *overrides = (proxy_server_conf *) overridesv;

   
    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->aliases = apr_array_append(p, base->aliases, overrides->aliases);      
   

   
    ... ...


    return ps;
}

Is this a bug ? or I misunderstood the usage of this directive ?

Thanks !
Comment 1 silencer018 2015-07-27 09:06:16 UTC
Is there anybody can help me take a look ?

Thanks