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 2012/12/17 11:46:24 UTC

[Bug 54319] New: ProxyPass has no effect in if rewrite occurs

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

            Bug ID: 54319
           Summary: ProxyPass has no effect in <Location> if rewrite
                    occurs
           Product: Apache httpd-2
           Version: 2.4.3
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core
          Assignee: bugs@httpd.apache.org
          Reporter: laurent.bod+bugzilla@gmail.com
    Classification: Unclassified

Hi all,
My Apache is configured as a reverse proxy :

  RewriteCond     %{REQUEST_URI}  ^/pioupiou/
  RewriteRule     ^/pioupiou/     /mirror/foo/ [PT]

  <Location /mirror/foo/>
      ProxyPass http://backend.example.com/
  </Location>

If I request : http://mondomain/mirror/foo/ => I access correctly to
backend.example.com/
If I request : http://mondomain/pioupiou/ => Apache is rewritting correctly but
return an HTTP404 /htdocs/mirror not found (in other words, the ProxyPass have
been ignore)

If I remove the <Location> notation and get the right syntax for ProxyPass :
  RewriteCond     %{REQUEST_URI}  ^/pioupiou/
  RewriteRule     ^/pioupiou/     /mirror/foo/ [PT]

  ProxyPass /mirror/foo/ http://backend.example.com/

If I request : http://mondomain/pioupiou/ => it works !!

-- 
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 54319] ProxyPass has no effect in if rewrite occurs

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

sebmoule <se...@orange.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sebastien.allamand@orange.c
                   |                            |om

-- 
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


Re: [Bug 54319] New: ProxyPass has no effect in if rewrite occurs

Posted by Graham Leggett <mi...@sharp.fm>.
On 1 Jan 2013, at 20:28, Eric Covener <co...@gmail.com> wrote:

> Also, is there some kind of benefit alluded to recently about using
> ProxyPass inside Location?  Can someone expound on that?

Performance.

Before, you had to walk the locations, then walk the proxypasses. Now, you just walk the locations.

Regards,
Graham
--


Re: [Bug 54319] New: ProxyPass has no effect in if rewrite occurs

Posted by Graham Leggett <mi...@sharp.fm>.
On 1 Jan 2013, at 21:01, Eric Covener <co...@gmail.com> wrote:

> I realized another workaround is to define the mod_rewrite rules in
> per-dir context, since this makes every URL change into an internal
> subrequest.

+1, again a big performance win on sites with complex URL spaces.

> Adding a flag to mod_rewrite in non per-dir context to also do the
> internal subrequest seems to work as well, and might be the most
> generally useful.

+1.

Regards,
Graham
--


Re: [Bug 54319] New: ProxyPass has no effect in if rewrite occurs

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jan 1, 2013 at 2:41 PM, Nick Kew <ni...@webthing.com> wrote:
> On Tue, 1 Jan 2013 14:28:52 -0500
> Eric Covener <co...@gmail.com> wrote:
>
>> Does anyone think this is worth preserving in 2.4,
>
> Not unless someone wants to do the work for its own sake.
> Sounds like back-compatibility for a hack that should
> never have been necessary in the first place.

I realized another workaround is to define the mod_rewrite rules in
per-dir context, since this makes every URL change into an internal
subrequest.

Adding a flag to mod_rewrite in non per-dir context to also do the
internal subrequest seems to work as well, and might be the most
generally useful.

Re: [Bug 54319] New: ProxyPass has no effect in if rewrite occurs

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 1 Jan 2013 14:28:52 -0500
Eric Covener <co...@gmail.com> wrote:

> Does anyone think this is worth preserving in 2.4, 

Not unless someone wants to do the work for its own sake.
Sounds like back-compatibility for a hack that should
never have been necessary in the first place.

-- 
Nick Kew

Fwd: [Bug 54319] New: ProxyPass has no effect in if rewrite occurs

Posted by Eric Covener <co...@gmail.com>.
In 2.2, ProxyPass in <Location caused entries to be added to the
per-server config.
In 2.4, it only adds to the per-dir config.

So in 2.4 it is no longer possible to rewrite with the PT flag and
target the argument to <Location> and have something proxied.

Does anyone think this is worth preserving in 2.4, maybe by also
storing the rules at the bottom of the per-server config?  Or should
we just document it in the Upgrading to 2.4... and maybe somewhere in
the extended mod_rewrite documentation?

Also, is there some kind of benefit alluded to recently about using
ProxyPass inside Location?  Can someone expound on that?

Thanks,


---------- Forwarded message ----------
From:  <bu...@apache.org>
Date: Mon, Dec 17, 2012 at 5:46 AM
Subject: [Bug 54319] New: ProxyPass has no effect in <Location> if
rewrite occurs
To: bugs@httpd.apache.org


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

            Bug ID: 54319
           Summary: ProxyPass has no effect in <Location> if rewrite
                    occurs
           Product: Apache httpd-2
           Version: 2.4.3
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core
          Assignee: bugs@httpd.apache.org
          Reporter: laurent.bod+bugzilla@gmail.com
    Classification: Unclassified

Hi all,
My Apache is configured as a reverse proxy :

  RewriteCond     %{REQUEST_URI}  ^/pioupiou/
  RewriteRule     ^/pioupiou/     /mirror/foo/ [PT]

  <Location /mirror/foo/>
      ProxyPass http://backend.example.com/
  </Location>

If I request : http://mondomain/mirror/foo/ => I access correctly to
backend.example.com/
If I request : http://mondomain/pioupiou/ => Apache is rewritting correctly but
return an HTTP404 /htdocs/mirror not found (in other words, the ProxyPass have
been ignore)

If I remove the <Location> notation and get the right syntax for ProxyPass :
  RewriteCond     %{REQUEST_URI}  ^/pioupiou/
  RewriteRule     ^/pioupiou/     /mirror/foo/ [PT]

  ProxyPass /mirror/foo/ http://backend.example.com/

If I request : http://mondomain/pioupiou/ => it works !!

--
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



--
Eric Covener
covener@gmail.com

[Bug 54319] ProxyPass has no effect in if rewrite occurs

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

--- Comment #2 from Laurent <la...@gmail.com> ---
Hi,
Any informations about this regression ?

Thanks in advance.

-- 
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 54319] ProxyPass has no effect in if rewrite occurs

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

sebmoule <se...@orange.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1

--- Comment #1 from sebmoule <se...@orange.com> ---
Hi,

I've got the same problem, is there a Big regression of how <Location> works
with mod_proxy ??

-- 
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 54319] ProxyPass has no effect in if rewrite occurs

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

--- Comment #3 from Eric Covener <co...@gmail.com> ---
This is a behavior change, I have started a discussion on dev@httpd.apache.org
to discuss if the 2.2 behavior needs to be preserved in 2.4 or just documented.

-- 
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