Skip to main content

How does Apache merge multiple matching Location sections [Resolved]

I'm working on some basic apache configuration, but I don't understand precisely how apache merges different sections when several of them match an incoming requests URL. The apache documentation in its "How the sections are merged" chapter is a little bit confusing when it comes to the order/priority of several matching sections of the same type.

For example, imagine the following apache configuration (ignore whether the actual contents make sense or not, I'm only interested in the application order of each rule/section):


  ProxyPass http://backend.com/
  Order allow,deny
  Satisfy any



  Order allow,deny



  Order deny,allow
  Require valid-user
  Satisfy all



  ProxyPass !

Now if a client makes a request to /sub/foobar, which is the final configuration that will be applied to this request?

Is the applied configuration the equivalent of:

# All the directives contained in all the matchin Locations in declaration order
ProxyPass http://backend.com/
Order allow,deny
Satisfy any
Order allow,deny
Order deny,allow
Require valid-user
Satisfy all

or maybe

# same as above, but with longest matching path last
ProxyPass http://backend.com/
Order allow,deny
Satisfy any
Order deny,allow
Require valid-user
Satisfy all
Order allow,deny

or something completely different.

Thanks for your help, I'm really confusing.


Question Credit: LordOfThePigs
Question Reference
Asked July 11, 2018
Posted Under: Network
30 views
1 Answers

Your Answer
D:\Adnan\Candoerz\CandoProject\vQA