httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60479] New: Add some details about <Location> and ProxyPass
Date Wed, 14 Dec 2016 16:39:41 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60479

            Bug ID: 60479
           Summary: Add some details about <Location> and ProxyPass
           Product: Apache httpd-2
           Version: 2.4.23
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
          Assignee: docs@httpd.apache.org
          Reporter: khemir.med@gmail.com
  Target Milestone: ---

Hi,

During some tests, we saw a change between 2.2.31 and 2.4.23 on how the
ProxyPass directives are processed when they are in a <Location> directive.

For example, taking this configuration: 
<Location /foo>                                                                 
  ProxyPass         http://backend2/                                            
  ProxyPassReverse  http://backend2/                                            
</Location>                                                                     
<Location />                                                                    
  ProxyPass        http://backend1/                                             
  ProxyPassReverse http://backend1/                                             
</Location>   

In 2.2, when accessing to http://example.com/foo, we reach http://backend2/.
In 2.4, when accessing the same url, we reach http://backend1/.

This change in behaviour does not appear to be documented in the 2.2 -> 2.4
upgrade docs.
(Very carefully) comparing the documentation for ProxyPass between 2.2 and 2.4
shows the addition of a easily-missed but important line in 2.4 near the end of
the "Ordering ProxyPass Directives" bit about the interaction with <Location>
that reads:

"In contrast, only one ProxyPass directive can be placed in a Location block,
and the most specific location will take precedence."

Since /foo is a more specific location than /, this suggests that either order
of the <Location> sections in the example should result in /foo being forwarded
to backend2, but this is not the case.

After some more reflection on the issue, I realized that perhaps "most specific
location" should instead be interpreted as "the last <Location> section that
matched the request URI".
Indeed, as per the merging rules outlined in the "How the sections are merged"
documentation, <Location> blocks should generally be ordered in order from more
general appearing first, followed by more specific overrides for sub-URIs.

In that sense, both meanings of "most specific location" align.
However, this is not immediately clear to people with ProxyPass-inside-Location
configs coming from 2.2, where the <Location> blocks had to be flipped around
due to the behaviour of ProxyPass in 2.2.

So presumably the extra line in the "Ordering ProxyPass directives" block is
referring to the fact that the discrepancy of the order in which ProxyPasses
inside <Location>s are matched in 2.2 has now been fixed in 2.4, but then I
submit that:
  - the wording "most specific location" is ambiguous and not necessarily clear
to people coming from 2.2
  - this should perhaps get a mention in the 2.2 -> 2.4 upgrade docs

Thank you.

Kind regards,

M. Khemir

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message