]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mod_rewrite: URI-to-filename rewrites to transparently handle proxy mappings.
authorYann Ylavic <ylavic@apache.org>
Tue, 1 Mar 2022 13:26:03 +0000 (13:26 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 1 Mar 2022 13:26:03 +0000 (13:26 +0000)
commit815cf05bb2d506f44a35b65e93de393d5410c779
tree1643d725a751582414a23c89fd3376fa4fb1542c
parentba8558450e348e2ed7952ff2cff80f6b572ca309
mod_rewrite: URI-to-filename rewrites to transparently handle proxy mappings.

Since mod_rewrite works on r->filename and mod_proxy's mapping=servlet|decoded
sets its "proxy:" URL there at pre_translate_name stage (i.e. before
mod_rewrite's translate_name hook), users have to match the full proxy URL in
their RewriteRules to handle proxy mappings, which is not very friendly nor
consistent with how proxy non-mapping requests have to be matched.

Let's use r->filename = r->uri in hook_uri2file() for pre_trans'ed reverse
proxy requests, and restore r->filename to its original value if the request
was finally DECLINED (like in hook_fixup).

But if a proxy mapping gets rewritten to a non-proxy request, clear any
proxy specific r->proxyreq or r->handler so that processing continues
accordingly.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898509 13f79535-47bb-0310-9956-ffa450edef68
changes-entries/rewrite_vs_proxy_mapping.txt [new file with mode: 0644]
modules/mappers/mod_rewrite.c