Mailing List Archive

[Bug 63262] RewriteRule in <If> section matches against file system path instead of URI path
https://bz.apache.org/bugzilla/show_bug.cgi?id=63262

--- Comment #2 from Chris Seufert <chris@modd.com.au> ---
I have recently run into what I think is this issue with the following config:

<If "true" >
RewriteEngine On
RewriteCond "%{REQUEST_URI}" !^/___proxy_me/
RewriteRule ^/(.*)$ "/___proxy_me/$1"
# [L,NE,B=%\ |:]
</If>
ProxyPass /___proxy_me/ "http://backend/" upgrade=websocket

What ends up happening is the backend server receives a url like:
%{document_root}%{request_uri}

From logs of two apache servers main proxying to backend running in docker:

backend-1 | 172.21.0.2 - - [24/Mar/2024:10:49:02 +0000] "GET
/usr/local/apache2/htdocs/ HTTP/1.1" 404 196
main-1 | 172.21.0.1 - - [24/Mar/2024:10:49:02 +0000] "GET / HTTP/1.1" 404
196
backend-1 | 172.21.0.3 - - [24/Mar/2024:11:06:25 +0000] "GET
/usr/local/apache2/htdocs/test-url.html HTTP/1.1" 404 196
main-1 | 172.21.0.1 - - [24/Mar/2024:11:06:25 +0000] "GET /test-url.html
HTTP/1.1" 404 196

for repoduction using latest docker image version:
https://github.com/cseufert/apache-proxy-test-2

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