You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/10/06 21:56:21 UTC

DO NOT REPLY [Bug 51982] New: ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

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: bugs@httpd.apache.org
        ReportedBy: lmeyer@vmware.com
    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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

cweekly <cw...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #10 from cweekly <cw...@gmail.com> ---
I don't think the backport was applied successfully in 2.2.26. That is, I
believe this issue remains unresolved in 2.2.26. (I ran into it on 2.2.22, and
found identical behavior in 2.2.26.) I ended up migrating to 2.4(.9) where it
is in fact resolved.

I don't have time to recreate my 2.2.26 conf details here, but I can attest we
saw this exact problem: extra slash introduced in Location header of redirect
response from proxied apps, when proxying to a balancer (vs directly to a
particular member -- which didn't meet our needs). 

Sorry for not having more rigorous details to reprod, but for anyone reading
this experiencing frustration, may I heartily recommend biting the bullet and
upgrading to 2.4. In the end our conf is cleaner and more concise, and
mod_proxy_balancer + mod_rewrite are working in perfect harmony to route
requests to one of multiple load-balanced apps behind a given apache. 

I'm reopening this to draw attention to it, but sorry in advance for not having
time to discuss it much further.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

sven.peters@aapt.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sven.peters@aapt.com.au

-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

William A. Rowe Jr. <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from William A. Rowe Jr. <wr...@apache.org> ---
This is now committed for inclusion in a future 2.2.25

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #3 from Carlo Timmers <ca...@dsm.com> 2012-04-20 21:54:20 UTC ---
(In reply to comment #2)
> This bug also exists in apache 2.2.12 and 2.2.22

Patch available in https://issues.apache.org/bugzilla/show_bug.cgi?id=51489
solved the issue for me.

-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #1 from sven.peters@aapt.com.au 2011-11-15 02:24:18 UTC ---
I ran into this problem too and didn't find a workaround yet.
My config

# Works perfect

ProxyPass / http://localhost:9381/
ProxyPassReverse / http://localhost:9381/

# Doesn't work when receiving Redirects / Location from the backend. An extra
leading '/' is added.
#
# ProxyPass / balancer://balancer/
# ProxyPassReverse / balancer://balancer/

<Proxy balancer://balancer/>
        BalancerMember http://localhost:9381/ retry=1
        BalancerMember http://localhost:9382/ retry=1 status=D
</Proxy>

Any workaround is appreciated.

-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #7 from Bong Samson <sa...@yahoo.com> ---
William, your changes for the httpd-2.2 proxy double slash tested successfully.
Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #8 from William A. Rowe Jr. <wr...@apache.org> ---
Added to 2.2 STATUS for review.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

Carlo Timmers <ca...@dsm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlo.timmers@dsm.com

-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #4 from sven.peters@aapt.com.au ---
Does somebody have a patch for 2.2.22 for this?

The above patch seems to be for an older version and the logic seemed to have
changed (I only checked .21 and .22).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #5 from Ajay Sindwani <as...@hotmail.com> ---
The workaround to this problem is to put multiple ProxyPassReverse directives,
one for each balancer member

ProxyPass / balancer://balancer/
ProxyPassReverse / http://localhost:9381/
ProxyPassReverse / http://localhost:9382/

Does anybody know if this is fixed in a later version of Httpd?  If so which
versions?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #2 from Carlo Timmers <ca...@dsm.com> 2012-04-20 21:39:00 UTC ---
This bug also exists in apache 2.2.12 and 2.2.22

-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51982] ProxyPassReverse / balancer://cluster/ adds slash to redirect (really!)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51982

--- Comment #6 from William A. Rowe Jr. <wr...@apache.org> ---
Created attachment 30179
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30179&action=edit
httpd-2.2 backport of proxy doubleslash fixes r1386576, r1386578

Folks, please test the attached backport before I submit it to STATUS.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org