Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 78571 invoked from network); 26 Aug 2004 01:26:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 26 Aug 2004 01:26:46 -0000 Received: (qmail 39737 invoked by uid 500); 26 Aug 2004 01:26:28 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 39537 invoked by uid 500); 26 Aug 2004 01:26:27 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 39523 invoked by uid 99); 26 Aug 2004 01:26:27 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [65.40.111.176] (HELO anculare.nvinity.net) (65.40.111.176) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 25 Aug 2004 18:26:23 -0700 Received: from localhost ([127.0.0.1] helo=newmail.nvinity.net) by anculare.nvinity.net with esmtp (Exim 4.34) id 1C08zr-0003DU-GT for users@httpd.apache.org; Wed, 25 Aug 2004 21:24:11 -0400 Received: from 192.168.2.2 (proxying for 192.168.1.1) (SquirrelMail authenticated user invinity); by newmail.nvinity.net with HTTP; Wed, 25 Aug 2004 21:24:11 -0400 (EDT) Message-ID: <43961.192.168.2.2.1093483451.squirrel@192.168.2.2> Date: Wed, 25 Aug 2004 21:24:11 -0400 (EDT) From: "Matthew Pitts" To: "Apache users mailing list " User-Agent: SquirrelMail/1.5.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Checked: Checked Subject: [users@httpd] mod_rewrite proxy with dynamic ProxyPassReverse X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hey all, I have been searching for a solution to my problem and I found a lot of sites that came close, but I have not been able to nail this one down. I have been writing a Perl module to manage Apache2 processes, each of which obviously runs on a different port. There is a main Apache process that listens on port 80, which proxies requests to the appropriate server on another port using a mod_rewrite RewriteMap. The following code shows the mod_rewrite configuration for the server running on port 80: RewriteEngine on RewriteLog logs/mod_rewrite-log RewriteMap aivh prg:/usr/bin/aivh_rewriter RewriteRule ^proxy:.* - [F] RewriteRule ^(.*)$ http://${aivh:%{HTTP_HOST}}$1 [P] The program /usr/bin/aivh_rewriter accepts the HTTP_HOST, does a lookup, and returns a fully qualified domain name with a port number appended. For instance, if the script were passed an HTTP_HOST of 'www.somedomain.com', it might return 'www.somedomain.com:9000'. This provides the proper proxing of the client request, but it doesn't provide the functionality of ProxyPassReverse when the backend server sends a redirect. Unfortunately, there are too many hosts right now to justify individual declarations of ProxyPassReverse. I thought about using a section to dynamically configure ProxyPass and ProxyPassReverse based on the RewriteMap program, but that would require a server restart every time a new host was added. Essentially, if mod_rewrite had another flag, say 'PR', that implemented the functionality of ProxyPassReverse, I would be golden. Is there a way to provide the same functionality as ProxyPassReverse, but in a dynamic, per-request lookup fashion as with the mod_rewrite RewriteMap? I thank you in advance for your help. Matt Pitts invinity@nvinity.net --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See 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