You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Evgeny Kotkov <ev...@visualsvn.com> on 2016/05/12 14:34:07 UTC

[PATCH] mod_rewrite: support proxying via mod_proxy_http2

I noticed that it's currently impossible to use mod_proxy_http2 in
conjunction with mod_rewrite's [P] request proxying:

    RewriteEngine  On
    RewriteRule  ^/foo  h2c://hostname/bar  [P]

mod_proxy_http2 registers on h2:// and h2c:// proxy URLs [1], however,
mod_rewrite needs an update to handle these as absolute URIs.  Without
that, the configuration above is going to produce incorrectly rewritten
rewritten URLs, e.g.:

   http://www.example.org/h2c://hostname/bar

I attached the patch with a fix for this issue.  The second patch adds
the corresponding tests to the mod_http2 testing framework.

[1] https://mail-archives.apache.org/mod_mbox/httpd-dev/201602.mbox/%3CCCC0EA0E-00CE-430D-A01C-022E7A2FFE16@greenbytes.de%3E


Regards,
Evgeny Kotkov

Re: [PATCH] mod_rewrite: support proxying via mod_proxy_http2

Posted by Stefan Eissing <st...@greenbytes.de>.
Ok, thanks. Your patch was added to trunk in r1744206 and I will propose it for backporting.

Cheers,
  Stefan

> Am 13.05.2016 um 12:13 schrieb Evgeny Kotkov <ev...@visualsvn.com>:
> 
> Stefan Eissing <st...@greenbytes.de> writes:
> 
>> Hmm, can someone with more brains than me on mod_rewrite look at the
>> first patch if we want to add handling for h2: and h2c: uri schemes
>> here or if there is a better way? Thanks.
> 
> In case this will help the review, here are some of the existing changes
> that target similar problems (mod_rewrite not picking up a new scheme
> for proxy URLs).  I examined them prior to preparing the patch:
> 
>  https://svn.apache.org/r1528556
>  https://svn.apache.org/r405625
>  https://svn.apache.org/r124584
> 
> 
> Regards,
> Evgeny Kotkov


Re: [PATCH] mod_rewrite: support proxying via mod_proxy_http2

Posted by Evgeny Kotkov <ev...@visualsvn.com>.
Stefan Eissing <st...@greenbytes.de> writes:

> Hmm, can someone with more brains than me on mod_rewrite look at the
> first patch if we want to add handling for h2: and h2c: uri schemes
> here or if there is a better way? Thanks.

In case this will help the review, here are some of the existing changes
that target similar problems (mod_rewrite not picking up a new scheme
for proxy URLs).  I examined them prior to preparing the patch:

  https://svn.apache.org/r1528556
  https://svn.apache.org/r405625
  https://svn.apache.org/r124584


Regards,
Evgeny Kotkov

Re: [PATCH] mod_rewrite: support proxying via mod_proxy_http2

Posted by Stefan Eissing <st...@greenbytes.de>.
Hmm, can someone with more brains than me on mod_rewrite look at the first patch if we want to add handling for h2: and h2c: uri schemes here or if there is a better way? Thanks.

-Stefan

> Am 12.05.2016 um 16:34 schrieb Evgeny Kotkov <ev...@visualsvn.com>:
> 
> I noticed that it's currently impossible to use mod_proxy_http2 in
> conjunction with mod_rewrite's [P] request proxying:
> 
>    RewriteEngine  On
>    RewriteRule  ^/foo  h2c://hostname/bar  [P]
> 
> mod_proxy_http2 registers on h2:// and h2c:// proxy URLs [1], however,
> mod_rewrite needs an update to handle these as absolute URIs.  Without
> that, the configuration above is going to produce incorrectly rewritten
> rewritten URLs, e.g.:
> 
>   http://www.example.org/h2c://hostname/bar
> 
> I attached the patch with a fix for this issue.  The second patch adds
> the corresponding tests to the mod_http2 testing framework.
> 
> [1] https://mail-archives.apache.org/mod_mbox/httpd-dev/201602.mbox/%3CCCC0EA0E-00CE-430D-A01C-022E7A2FFE16@greenbytes.de%3E
> 
> 
> Regards,
> Evgeny Kotkov
> <h2-proxy-rewrite-v1.patch.txt><h2-proxy-rewrite-test-v1.patch.txt>