From: Jeff Trawick
Date: Wed, 16 Oct 2013 17:11:29 +0000 (+0000)
Subject: Interpolation worked within the scheme portion of URLs for
X-Git-Tag: 2.5.0-alpha~4935
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9db7c3545d9b2474fd5fc0db2db90c5d0be6eab3;p=apache
Interpolation worked within the scheme portion of URLs for
ProxyPass and ProxyPassReverse until a fix to apr_uri_parse()
in APR-Util 1.5.2 closed the hole that had previously allowed
the necessary {} characters within the scheme.
Lack of support for interpolation within the scheme will be a
permanent limitation.
The mod_proxy documentation is updated to provide an alternate
configuration solution.
PR: 55315
Submitted by: Mike Rumph
Tweaked by: trawick
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532816 13f79535-47bb-0310-9956-ffa450edef68
---
diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml
index 293aab504e..89c2771bd7 100644
--- a/docs/manual/mod/mod_proxy.xml
+++ b/docs/manual/mod/mod_proxy.xml
@@ -1238,15 +1238,6 @@ ProxyPass / balancer://hotcluster/
removes the normal limited protection against URL-based attacks
provided by the proxy.
- The optional interpolate keyword (available in
- httpd 2.2.9 and later), in combination with
- ProxyPassInterpolateEnv causes the ProxyPass
- to interpolate environment variables, using the syntax
- ${VARNAME}. Note that many of the standard CGI-derived
- environment variables will not exist when this interpolation happens,
- so you may still have to resort to mod_rewrite
- for complex rules.
-
Normally, mod_proxy will include the query string when
generating the SCRIPT_FILENAME environment variable.
The optional noquery keyword (available in
@@ -1268,6 +1259,30 @@ ProxyPass / balancer://hotcluster/
RewriteRule directive with the
[P]
flag.
+ The optional interpolate keyword (available in
+ httpd 2.2.9 and later), in combination with
+ ProxyPassInterpolateEnv causes the ProxyPass
+ to interpolate environment variables, using the syntax
+ ${VARNAME}. Note that many of the standard CGI-derived
+ environment variables will not exist when this interpolation happens,
+ so you may still have to resort to mod_rewrite
+ for complex rules. Also note that interpolation is not supported
+ within the scheme portion of a URL. Dynamic determination of the
+ scheme can be accomplished with mod_rewrite as in the
+ following example.
+
+
+RewriteEngine On
+
+RewriteCond %{HTTPS} =off
+RewriteRule . - [E=protocol:http]
+RewriteCond %{HTTPS} =on
+RewriteRule . - [E=protocol:https]
+
+RewriteRule ^/mirror/foo/(.*) %{ENV:protocol}://backend.example.com/$1 [P]
+ProxyPassReverse /mirror/foo/ http://backend.example.com/
+ProxyPassReverse /mirror/foo/ https://backend.example.com/
+
@@ -1399,7 +1414,8 @@ ProxyPassReverseCookiePath / /mirror/foo/
httpd 2.2.9 and later), used together with
ProxyPassInterpolateEnv, enables interpolation
of environment variables specified using the format ${VARNAME}.
-
+ Note that interpolation is not supported within the scheme portion of a
+ URL.
When used inside a Location section, the first argument is omitted and the local