From: Luca Toscano
<ProxyMatch>
containers apply enclosed configuration directives only
to sites accessed through mod_proxy's proxy server
-that match the specified URL. For example, the following configuration
-will prevent the proxy server from being used to access the
-www.example.com website.
+that match the specified URL. For example, the following configuration
+will allow only a subset of clients to access the
+www.example.com website using the proxy server:
<Proxy http://www.example.com/*> - Require all granted + Require host yournetwork.example.com </Proxy>@@ -452,12 +452,17 @@ are interpreted, it is important to understand how this works. container takes the place of the
<Directory> container in the processing
order.
+Later sections override earlier ones, however each module is responsible for interpreting what form this override takes. A later configuration section with directives from a given module might cause a conceptual "merge" of some directives, all directives, or a complete replacement of the modules configuration with the module defaults and directives explicitly listed in the later context.
+Directory, FilesMatch,
+ Location and the other directives discussed in this section
+ implement the same merging strategy, namely "override" when applied to the same target.
Another interesting example is the following one. As described above,
+FilesMatch is merged after Directory,
+therefore a request for /var/www/index.html will eventually get the "foo" Header set to
+the value "two", not "three" as somebody might expect from a first look.
+
<Directory "/"> + Header set foo one + <FilesMatch ".*"> + Header set foo two + </FilesMatch> +</Directory> + +<Directory "/var/www"> + Header set foo three +</Directory>+ + +
The chain of values that the "foo" header will get is: "one", "three" and "two".
+It is important to notice that Directory and FilesMatch
+implement the same merging strategy, namely "override" when
+applied to the same path. In this example it means that the last directive applied in the merging order,
+FilesMatch, sets the final value for the "foo" header.
+
This is true for .htaccess too, since they have the same priority as Directory
+in the merging order.
For a more concrete example, consider the following. Regardless of
any access restrictions placed in <Directory> sections, the <Location> section will be
evaluated last and will allow unrestricted access to the server. In