Return-Path: Delivered-To: apmail-modperl-archive@apache.org Received: (qmail 31384 invoked by uid 500); 18 Feb 2002 14:52:13 -0000 Mailing-List: contact modperl-help@apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@apache.org Received: (qmail 31370 invoked from network); 18 Feb 2002 14:52:12 -0000 Date: Mon, 18 Feb 2002 17:51:56 +0300 (MSK) From: Igor Sysoev X-Sender: is@is To: Andrew Green cc: modperl@apache.org Subject: Re: PerlPassEnv and Proxies In-Reply-To: <4b0abe5012andrew@article7.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Mon, 18 Feb 2002, Andrew Green wrote: > I'm using a typical dual-server combination for mod_perl content on a > selection of sites. Requests go to the vanilla Apache and a > mod_rewrite/mod_proxy combo forward them on to the mod_perl Apache. > > As part of this, I'm trying to allow a prefix to the URL path to set an > environment variable I can then use in my mod_perl programs to determine > databases, templates etc. > > The vanilla httpd.conf features a line thus: > > RewriteRule ^/(test|access|ewok)/(.*)$ > http://spare.article7.co.uk:8080/page/$2 [P,E=A7_FRAMEWORK:$1,L] > > (ignoring the wrapping). I also set PerlPassEnv A7_FRAMEWORK in my > mod_perl httpd.conf -- but that environment variable always remains > undef. The order of the P,E,L flags doesn't seem to make a difference. > > I appreciate that this is perhaps more of a mod_proxy issue than a > mod_perl one, but I suspect I'm not alone in having tried something > similar. I haven't found anything in the guide that deals with this > specifically (I really don't want to append the information as a query > string), but if I've overlooked anything, I'd be very happy to be > corrected. You set A7_FRAMEWORK in vanilla Apache so mod_perl Apache does not receive it. You can try my mod_accel module. It send original URL to backend in X-URL header. Also you do not need to use mod_rewrite if you want to exclude some URL from proxing. Igor Sysoev