httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bond" <jamesbond_...@hotmail.com>
Subject [users@httpd] rewrite map and proxy loop
Date Mon, 02 Jun 2003 00:30:55 GMT
Hi,
I have configured my apache proxy server to execute a external perl program 
when it receives a request from the clinet. I am using apache 2.0.45 on 
Linux.
Following is the rewrite context and the program:

Rewrite rules:
--------------------
RewriteEngine on
RewriteLog "/export/apps/apache/2.0.45/logs/rewrite/rewrite_test"
RewriteLogLevel 9
RewriteMap    lb      prg:/export/apps/apache/conf/lb.pl
RewriteRule   ^/(.*)$ ${lb:$1}           [P,L]
Proxypassreverse  /  ${lb:$1}

lb.pl program:
-------------------
#!/usr/bin/perl
##
print "http://www.yahoo.com";


Now this setup works when I access the reverse proxy server ip address for 
the first time. I get the following messages in the rewrite log file with 
correct values fro key and value.
When i access the reverse proxy server ip address for the second time then 
it goes in a loop an throw the following error on the browser:
----------------------------------------
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: Max-Forwards has reached zero - proxy loop?

-------------------------------------------

I get the following repeated messages in rewrite log file:



192.1.1.100 - - [02/Jun/2003:01:27:21 +0100] 
[192.1.1.100/sid#80e3f80][rid#8136790/initial] (2) init rewrite engine with 
requested uri /
192.1.1.100 - - [02/Jun/2003:01:27:21 +0100] 
[192.1.1.100/sid#80e3f80][rid#8136790/initial] (3) applying pattern 
'^/(.*)$' to uri '/'
192.1.1.100 - - [02/Jun/2003:01:27:21 +0100] 
[192.1.1.100/sid#80e3f80][rid#8136790/initial] (5) map lookup OK: map=lb 
key= -> val=
192.1.1.100 - - [02/Jun/2003:01:27:21 +0100] 
[192.1.1.100/sid#80e3f80][rid#8136790/initial] (2) rewrite / ->
192.1.1.100 - - [02/Jun/2003:01:27:21 +0100] 
[192.1.1.100/sid#80e3f80][rid#8136790/initial] (2) forcing proxy-throughput 
with http://192.1.1.100/
192.1.1.100 - - [02/Jun/2003:01:27:21 +0100] 
[192.1.1.100/sid#80e3f80][rid#8136790/initial] (1) go-ahead with proxy 
request proxy:http://192.1.1.100/ [OK]


Any help or advice will be appreciated.


Thanks
jerry

_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today! 
http://www.msn.co.uk/messenger


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


Mime
View raw message