httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mike venzke <>
Subject mod_proxy per-directory settings handling
Date Tue, 15 Jun 2010 12:36:36 GMT
We've been trying to reconcile various issues in config file Location
inheritance in httpd 2.2. In reading the core code, we've determined that
Locations truly are read and merged in order, and the most-specific (longest
Location strings) should go last. Therefore, we order our Locations in
increasing length order.

However, this caused some value inheritance problems in some modules. In
some, there were issues with "*_set" variables not being properly merged, so
some boolean values wouldn't merge right. We've resolved those, but there
continue to be problems in some configuration settings in mod_proxy that
we've added, even though the per-dir merging appears to be valid.

We believe we've tracked this down to how mod_proxy translates urls, in

It iterates conf->aliases->nelts in forward order, and stops once it finds a
match. Assuming standard apache config ordering of least-specific to
most-specific, this will stop at the first matching path, likely "/".

If they later have underlying Locations, like "/images/", it won't be
matched here, even if the url is within "/images/". I'm not exactly clear on
what part of this hook is then setting some variable that determines which
per-dir config to use in the proxy handler, maybe it's just because filename
is set here.

Either way, reversing the order of the iteration through the conf->aliases
in "proxy_trans()" seems to achieve what we want. Now, the variables are
using their most-specific setting. As far as I can understand, starting at
the most-specific and stopping at the first match won't affect variable
inheritance from some less-specific Location, because that's all handled
elsewhere when the configs are merged. This hook is only about translating
the proxied url, so there's no need to go through all the Locations, but it
is important to pick only the most-specific Location.

I can't find a bug report about this or talk on this list, but it seems like
something that other people would have complained about if it's true, but to
us it sure seems like it is.

Am I wrong? Is there some other reason why mod_proxy needs to go through the
aliases in forward order, maybe related to regex matching?


- Mike

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message