Apache not invoking mod_proxy when there's an encoded '/' (%2F) in the path
(sending this for the 2nd time -- first didn't show up, apologies if you receive it twice)
Hi folks,
I've set up mod_proxy as a reverse proxy and am encountering a problem.
When I browse the proxied site, most pages load fine, but if there's an
encoded '/' (%2F) in the URL's path, it causes Apache to generate an
internal 404 and not even pass the request to the mod_proxy.
Here's an example of a problem URL (note: this isn't the actual hostname):
http://www.mysite.com/Product/1917--HON+Comfortask%2f%c2%ae+ Task+Swivel+Stool--s
Note the "%2f" after the term "Comfortask", which is causing Apache to
not make this a proxy request. Unfortunately the site I'm working on
is built with an e-commerce system that puts all information in the path
rather than proper URL parameters!
FYI I've got my proxy server configured as follows:
<VirtualHost X.X.X.X:80>
ServerName www.mysite.com
ProxyRequests Off
ProxyPass / http://Y.Y.Y.Y:80/
ProxyPassReverse / http://Y.Y.Y.Y:80/
ProxyPassReverse / http://Y.Y.Y.Y/
ProxyTimeout 120
ProxyPreserveHost On
</VirtualHost>
(X.X.X.X is the proxy server IP, and Y.Y.Y.Y is the upstream web server.)
Any ideas why Apache is getting confused by the %2F? Workarounds?
thanks,
Eric
RE: Apache not invoking mod_proxy when there's an encoded '/' (%2
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C4CB59.30C1C670
Content-Type: text/plain
Add the AllowEncodedSlashes directive in the VirtualHost to allow encoded
slashes to be used.
See http://httpd.apache.org/docs-2.0/mod/core.html#allowencodeds lashes for
more info.
Larry.
-----Original Message-----
From: Eric J. Hansen [mailto:ehansen [at] worldmachine.com]
Sent: Monday, November 15, 2004 4:24 PM
To: modproxy-dev [at] apache.org
Subject: Apache not invoking mod_proxy when there's an encoded '/' (%2F) in
the path
(sending this for the 2nd time -- first didn't show up, apologies if you
receive it twice)
Hi folks,
I've set up mod_proxy as a reverse proxy and am encountering a problem.
When I browse the proxied site, most pages load fine, but if there's an
encoded '/' (%2F) in the URL's path, it causes Apache to generate an
internal 404 and not even pass the request to the mod_proxy.
Here's an example of a problem URL (note: this isn't the actual hostname):
http://www.mysite.com/Product/1917--HON+Comfortask%2f%c2%ae+ Task+Swivel+Stoo
l--s
Note the "%2f" after the term "Comfortask", which is causing Apache to
not make this a proxy request. Unfortunately the site I'm working on
is built with an e-commerce system that puts all information in the path
rather than proper URL parameters!
FYI I've got my proxy server configured as follows:
<VirtualHost X.X.X.X:80>
ServerName www.mysite.com
ProxyRequests Off
ProxyPass / http://Y.Y.Y.Y:80/
ProxyPassReverse / http://Y.Y.Y.Y:80/
ProxyPassReverse / http://Y.Y.Y.Y/
ProxyTimeout 120
ProxyPreserveHost On
</VirtualHost>
(X.X.X.X is the proxy server IP, and Y.Y.Y.Y is the upstream web server.)
Any ideas why Apache is getting confused by the %2F? Workarounds?
thanks,
Eric
------_=_NextPart_001_01C4CB59.30C1C670
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2658.2">
<TITLE>RE: Apache not invoking mod_proxy when there's an encoded '/' =
(%2F) in the path</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=3D2>Add the AllowEncodedSlashes directive in the =
VirtualHost to allow encoded slashes to be used.</FONT>
</P>
<P><FONT SIZE=3D2>See <A =
HREF=3D"http://httpd.apache.org/docs-2.0/mod/core.html#allow encodedslash=
es" =
TARGET=3D"_blank">http://httpd.apache.org/docs-2.0/mod/core. html#allowen=
codedslashes</A> for more info.</FONT>
</P>
<P><FONT SIZE=3D2>Larry.</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Eric J. Hansen [<A =
HREF=3D"mailto:ehansen [at] worldmachine.com">mailto:ehansen [at] worl dmachine.com=
</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Monday, November 15, 2004 4:24 PM</FONT>
<BR><FONT SIZE=3D2>To: modproxy-dev [at] apache.org</FONT>
<BR><FONT SIZE=3D2>Subject: Apache not invoking mod_proxy when there's =
an encoded '/' (%2F) in the path</FONT>
</P>
<P><FONT SIZE=3D2>(sending this for the 2nd time -- first didn't show =
up, apologies if you receive it twice)</FONT>
</P>
<P><FONT SIZE=3D2>Hi folks,</FONT>
</P>
<P><FONT SIZE=3D2>I've set up mod_proxy as a reverse proxy and am =
encountering a problem.</FONT>
<BR><FONT SIZE=3D2>When I browse the proxied site, most pages load =
fine, but if there's an</FONT>
<BR><FONT SIZE=3D2>encoded '/' (%2F) in the URL's path, it causes =
Apache to generate an</FONT>
<BR><FONT SIZE=3D2>internal 404 and not even pass the request to the =
mod_proxy.</FONT>
</P>
<P><FONT SIZE=3D2>Here's an example of a problem URL (note: this isn't =
the actual hostname):</FONT>
</P>
<P><FONT SIZE=3D2><A =
HREF=3D"http://www.mysite.com/Product/1917--HON+Comfortask%2 f%c2%ae+Task=
+Swivel+Stool--s" =
TARGET=3D"_blank">http://www.mysite.com/Product/1917--HON+Co mfortask%2f%=
c2%ae+Task+Swivel+Stool--s</A></FONT>
</P>
<P><FONT SIZE=3D2>Note the "%2f" after the term =
"Comfortask", which is causing Apache to</FONT>
<BR><FONT SIZE=3D2>not make this a proxy request. Unfortunately the =
site I'm working on</FONT>
<BR><FONT SIZE=3D2>is built with an e-commerce system that puts all =
information in the path</FONT>
<BR><FONT SIZE=3D2>rather than proper URL parameters!</FONT>
</P>
<P><FONT SIZE=3D2>FYI I've got my proxy server configured as =
follows:</FONT>
</P>
<P><FONT SIZE=3D2><VirtualHost X.X.X.X:80></FONT>
<BR><FONT SIZE=3D2> ServerName =
www.mysite.com</FONT>
<BR><FONT SIZE=3D2> ProxyRequests =
Off</FONT>
<BR><FONT SIZE=3D2> =
ProxyPass &nb=
sp; &nb=
sp; / <A =
HREF=3D"http://Y.Y.Y.Y:80/" =
TARGET=3D"_blank">http://Y.Y.Y.Y:80/</A></FONT>
<BR><FONT SIZE=3D2> =
ProxyPassReverse &n=
bsp; &n=
bsp; / <A HREF=3D"http://Y.Y.Y.Y:80/" =
TARGET=3D"_blank">http://Y.Y.Y.Y:80/</A></FONT>
<BR><FONT SIZE=3D2> =
ProxyPassReverse &n=
bsp; &n=
bsp; / <A HREF=3D"http://Y.Y.Y.Y/" =
TARGET=3D"_blank">http://Y.Y.Y.Y/</A></FONT>
<BR><FONT SIZE=3D2> =
ProxyTimeout =
=
120</FONT>
<BR><FONT SIZE=3D2> =
ProxyPreserveHost On</FONT>
<BR><FONT SIZE=3D2></VirtualHost></FONT>
</P>
<P><FONT SIZE=3D2>(X.X.X.X is the proxy server IP, and Y.Y.Y.Y is the =
upstream web server.)</FONT>
</P>
<P><FONT SIZE=3D2>Any ideas why Apache is getting confused by the =
%2F? Workarounds?</FONT>
</P>
<P><FONT SIZE=3D2>thanks,</FONT>
<BR><FONT SIZE=3D2>Eric</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C4CB59.30C1C670--