https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

             Bug #: 51982
           Summary: ProxyPassReverse / balancer://cluster/ adds slash to
                    redirect (really!)
           Product: Apache httpd-2
           Version: 2.2.21
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


This report appears similar to some others, like 39203 and particularly 51489.
But I believe the following configuration demonstrates a specific problem
simply and is in fact a bug - feel free to prove me wrong:

<Proxy balancer://cluster >
BalancerMember http://localhost:8080
</Proxy>

ProxyPass / balancer://cluster/
# option 1
ProxyPassReverse / http://localhost:8080/
# option 2
ProxyPassReverse / balancer://cluster/

Option 1 and 2 should both correctly rewrite Location: headers from the
backend. Option 1 does, but option 2 adds an extra / - so if the request was
http://www.example.com/foo and the backend returns a Location:
http://localhost:8080/foo/ then the rewritten result will be
http://www.example.com//foo/ (with two slashes). Aside from looking/being
incorrect, any cookies with path /foo (as is common with backend applications)
won't match this path and thus the browser won't send them after the redirect.

Some things to note:
1. The behavior is no different with:
ProxyPassReverse / balancer://cluster
(i.e. without the trailing /)

2. This works fine if you do the following instead:
ProxyPass /foo balancer://cluster/foo
ProxyPassReverse /foo balancer://cluster
... however, the goal here is to proxy / (perhaps with exceptions) so there is
no way to eliminate the trailing slashes.

3. You can try other combinations of adding/removing trailing slashes to your
heart's content - I have not found one that both proxies to the correct backend
location (without adding/removing a slash) and rewrites Location correctly. The
only workaround is to ProxyPassReverse each of the individual BalancerMembers,
which is what the balancer:// construct is intended to avoid.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to