httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thias <Mark.Th...@bnpi.com>
Subject RE: [users@httpd] RewriteMap script puts newline character in URL
Date Thu, 18 Dec 2003 16:18:09 GMT

Thank you for your response, its seemed to make some progress. However, the
rule now gets applied endlessly...as in an endless loop. I've attached the
rewrite logs. For the purposes of this test I removed the round robin
feature of going from server1 to server2 and just always return server1. As
you can see from the logs, the resulting uri keeps growing longer. All this
occurs in one step and I have to shut down the browser down to stop it. 

I was thinking that perhaps since the resulting uri had the search pattern
in it (ctms) that maybe that's what caused the rule to be called repeatedly.
However, even after changing the search pattern to ctms1, I received the
same result.

httpd.conf:

RewriteEngine on
RewriteLogLevel 20
RewriteLog rewrite.log
RewriteMap servers "prg:C:/Tools/Python23/python.exe -u c:/proxy.py"
RewriteRule ^/ctms/(.*) ${servers:}  [P,L]
#RewriteRule ^/ctms1/(.*) ${servers:}  [P,L]     (tried this, same result)


Rewrite Log:

(2) init rewrite engine with requested uri /ctms/
(3) applying pattern '^/ctms/(.*)' to uri '/ctms/'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite /ctms/ -> http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri /ctms/apps/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri '/ctms/apps/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite /ctms/apps/login/login.jsp -> http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite /ctms/apps/login/apps/login/login.jsp ->
http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/apps/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite /ctms/apps/login/apps/login/apps/login/login.jsp ->
http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/apps/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/apps/login/apps/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite /ctms/apps/login/apps/login/apps/login/apps/login/login.jsp ->
http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/login.jsp ->
http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/logi
n.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/log
in.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/logi
n.jsp -> http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/apps
/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/app
s/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/apps
/login/login.jsp -> http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/apps
/login/apps/login/login.jsp
(3) applying pattern '^/ctms/(.*)' to uri
'/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/app
s/login/apps/login/login.jsp'
(5) map lookup OK: map=servers key= -> val=http://server1:8080/ctms/
(2) rewrite
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/apps
/login/apps/login/login.jsp -> http://server1:8080/ctms/
(2) forcing proxy-throughput with http://server1:8080/ctms/
(1) go-ahead with proxy request proxy:http://server1:8080/ctms/ [OK]
(2) init rewrite engine with requested uri
/ctms/apps/login/apps/login/apps/login/apps/login/apps/login/apps/login/apps
/login/apps/login/apps/login/login.jsp
-----Original Message-----
From: André Malo [mailto:nd@perlig.de]
Sent: Wednesday, December 17, 2003 5:19 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] RewriteMap script puts newline character in
URL


* Mark Thias <Mark.Thias@bnpi.com> wrote:

> I'm trying to use a RewriteMap and a RewriteRule for load balancing. I use
a
> python script in the RewriteMap to modify the URL but I get a newline
> character in the URL which causes a browser error.
> 
> HTTP ERROR: 404 /ctms/%0D Not Found 

Well, this is half a windows newline. (CR)
mod_rewrite should recognize it. Can you please file a bugreport regarding
the issue? (That way it doesn't get forgotten) A workaround for now is
described below.

> #!c:\Tools\Python23\python.exe

try adding the -u commandline option, like

#!c:\Tools\Python23\python.exe -u

If it doesn't work, use the -u option in your RewriteMap definition.

>         sys.stdout.flush()  ( if I don't have this, does not remap )

If you're using -u, this line is probably no longer necessary. In particular
it switches the channels (stdin/out/err) to unbuffered and binary handling.

(all untested, as usual ;-)

nd

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


This email may contain confidential and privileged material for the sole use
of the intended recipient. Any review or distribution by others is strictly
prohibited.  If you are not the intended recipient please contact the sender
and delete all copies.

Mime
View raw message