You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Jason R. Park" <ja...@jasonpark.com> on 2004/09/16 21:03:12 UTC

[users@httpd] Apache 1.3.29 to 1.3.31 issue with mod_rewrite/proxy

I am having a very odd issue since upgrading from Apache 1.3.29 to Apache
1.3.31.  I use mod_rewrite to do a proxy like so:

RewriteCond %{REQUEST_URI} ^/PROXYTHIS/.*
RewriteRule /PROXYTHIS/(.*)$ http://www.anotherdomain.com/$1  [P]

This works fine on 1.3.29 and other prior versions and has the following
functionality:

Original: http://www.thisdomain.com/PROXYTHIS/test.cgi?This=that
Rewrite Proxy: proxy:http://www.anotherdomain.com/test.cgi

-- Rewrite Log - From Apache 1.3.29 - Works Correctly --
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:45:07 -0500]
[www.thisdomain.com/sid#80ccc6c][rid#80c731c/initial] (3) applying pattern
'/PROXYTHIS/(.*)$' to uri '/home/thisuser/public_html/PROXYTHIS/test.cgi'
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:45:07 -0500]
[www.thisdomain.com/sid#80ccc6c][rid#80c731c/initial] (2) rewrite
/home/thisuser/public_html/PROXYTHIS/test.cgi ->
http://www.anotherdomain.com/test.cgi
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:45:07 -0500]
[www.thisdomain.com/sid#80ccc6c][rid#80c731c/initial] (2) forcing
proxy-throughput with http://www.anotherdomain.com/test.cgi
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:45:07 -0500]
[www.thisdomain.com/sid#80ccc6c][rid#80c731c/initial] (1) go-ahead with
proxy request proxy:http://www.anotherdomain.com/test.cgi [OK]
--

With Apache 1.3.31 though, I am getting some very unexpected behavior.  The
document path, if the original document actually existed and was not to be
rewritten, is appended to the proxy URL like so:

Original: http://www.thisdomain.com/PROXYTHIS/test.cgi?This=that
Rewrite Proxy:
proxy:http://www.anotherdomain.com/test.cgi/home/thisuser/public_html/PROXYT
HIS/test.cgi

-- Rewrite Log - From Apache 1.3.31 - INCORRECT --
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:47:13 -0500]
[www.thisdomain.com/sid#80d87bc][rid#80a5454/initial] (2) init rewrite
engine with requested uri /PROXYTHIS/test.cgi
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:47:13 -0500]
[www.thisdomain.com/sid#80d87bc][rid#80a5454/initial] (3) applying pattern
'/PROXYTHIS/(.*)$' to uri '/PROXYTHIS/test.cgi'
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:47:13 -0500]
[www.thisdomain.com/sid#80d87bc][rid#80a5454/initial] (2) rewrite
/PROXYTHIS/test.cgi -> http://www.anotherdomain.com/test.cgi
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:47:13 -0500]
[www.thisdomain.com/sid#80d87bc][rid#80a5454/initial] (2) forcing
proxy-throughput with http://www.anotherdomain.com/test.cgi
Xxx.xxx.xxx.xxx - - [16/Sep/2004:13:47:13 -0500]
[www.thisdomain.com/sid#80d87bc][rid#80a5454/initial] (1) go-ahead with
proxy request
proxy:http://www.anotherdomain.com/test.cgi/home/thisuser/public_html/PROXYT
HIS/test.cgi [OK]

I am not much of a C programmer, but I put in quite a bit of debug logging
into the mod_rewrite module and the stuff that is getting added on at the
end is coming from PATH_INFO, which is the PATH_INFO passed into mod_rewrite
as mod_rewrite does not modify it.  Any ideas on what would cause this or a
way to fix it?  It seem that it may be a bug arising in 1.3.31?

Best Regards,

Jason R. Park
E-Mail: jason@jasonpark.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org