Enable headers and proxy_http modules for balancer relation
`data/balancer.template` uses the `RequestHeader` directive (which
requires `mod_headers`) and `BalancerMember http://...` (which requires
`mod_proxy_http`). This can be worked around by explicitly configuring
both in `enable_modules`, but it would be better for the charm to do
this automatically.
A backend URL matches the configuration section if it begins with the
the wildcard-url string, even if the last path segment in the
directive only matches a prefix of the backend URL. For example,
<Proxy "http://example.com/foo"> matches all of http://example.com/foo, http://example.com/foo/bar, and http://example.com/foobar. The matching of the final URL differs from
the behavior of the <Location> section, which for purposes of this
note treats the final path component as if it ended in a slash.
This caused me considerable confusion recently when working with a
combination of the apache2 and squid-reverseproxy charms: I had multiple
balancers available, including "launchpad-appserver-main" and
"launchpad-appserver-main-cached", and spent ages trying to figure out
why requests to balancer://launchpad-appserver-main-cached/... were sent
to Squid with "X-Balancer-Name: launchpad-appserver-main". Eventually I
noticed this paragraph in the Apache documentation and was able to work
around the problem by using the name "cached-launchpad-appserver-main"
instead, but I don't think I should have had to do this.
URLs aimed at balancers will always have some kind of path component as
well as the balancer name, so it should be safe to add a trailing slash
to ensure that the `<Proxy>` directive doesn't accidentally match other
balancer names by prefix.