Discussion:
[PATCH] support for environment variables in ProxyPassReverse
Carsten Gaebler
2003-06-16 16:14:34 UTC
Permalink
Hi there,

the book "Linux Server Hacks" by Rob Flickenger contains an example on
how to use environment variables with the ProxyPassReverse directive. Of
course it doesn't work because it's not implemented. :-) But since it's
very useful for the proxy I'm maintaining and would also strip down this
ugly reverse mapping list in the URL Rewriting Guide, I wrote a patch
for Apache 1.3.27.

Basically it allows you to setup something like this:

RewriteRule ^/(.*)/ http://$1/ [P,E=WHERETO:$1]
ProxyPassReverse /%{ENV:WHERETO}/ http://%{ENV:WHERETO}/

The logical consequence would be for ProxyPass to support that, too. But
since this directive is handled in a different file and I don't know a
centralized place to put the expand_vars() function, I didn't do that.

Feel free to send comments.

Regards
Carsten.
Graham Leggett
2003-06-17 15:24:50 UTC
Permalink
Post by Carsten Gaebler
the book "Linux Server Hacks" by Rob Flickenger contains an example on
how to use environment variables with the ProxyPassReverse directive. Of
course it doesn't work because it's not implemented. :-) But since it's
very useful for the proxy I'm maintaining and would also strip down this
ugly reverse mapping list in the URL Rewriting Guide, I wrote a patch
for Apache 1.3.27.
Is it possible to create a patch for Apache v2.0?

Regards,
Graham
--
-----------------------------------------
***@sharp.fm "There's a moon
over Bourbon Street
tonight..."
Carsten Gaebler
2003-06-17 15:42:28 UTC
Permalink
Post by Graham Leggett
wrote a patch for Apache 1.3.27.
Is it possible to create a patch for Apache v2.0?
Sure. s/ap_/apr_/g should do, I guess. :-) Stay tuned.

cg.
Carsten Gaebler
2003-06-18 14:34:27 UTC
Permalink
[patch for 1.3.27 to support env vars in ProxyPassReverse]
Post by Graham Leggett
Is it possible to create a patch for Apache v2.0?
It's attached. I encountered one problem with Apache 1.3.27 and mod_ssl:
you have to apply the mod_ssl patches (i.e. run configure) *before* the
proxy patch. Otherwise the mod_ssl proxy patches don't get applied and
any proxy rewrite rules using https fall back to http. Maybe this is
something that should be taken care of.

cg.

Olivier DECKMYN
2003-06-18 07:04:43 UTC
Permalink
Any chance to see this patch included into Apache 1.3.28 ?
Received: from musique.teaser.net (musique.teaser.net [213.91.2.11])
by philo.teaser.net (lmtpd) with LMTP id 71259.152;
Mon, 16 Jun 2003 18:14:40 +0200 (CEST)
Received: from apache.org (daedalus.apache.org [208.185.179.12])
by musique.teaser.net (Postfix) with SMTP id F3D8772523
Received: (qmail 75585 invoked by uid 500); 16 Jun 2003 16:14:33 -0000
Precedence: bulk
Received: (qmail 75563 invoked from network); 16 Jun 2003 16:14:32 -0000
Date: Mon, 16 Jun 2003 18:14:34 +0200
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314
X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: [PATCH] support for environment variables in ProxyPassReverse
Content-Type: multipart/mixed;
boundary="------------080307000004060702020300"
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Text-Classification: good_mail
X-POPFile-Link: <http://127.0.0.1:9090/jump_to_message?view=popfile16377=3.msg>
Hi there,
the book "Linux Server Hacks" by Rob Flickenger contains an example on
how to use environment variables with the ProxyPassReverse directive. Of
course it doesn't work because it's not implemented. :-) But since it's
very useful for the proxy I'm maintaining and would also strip down this
ugly reverse mapping list in the URL Rewriting Guide, I wrote a patch
for Apache 1.3.27.
RewriteRule ^/(.*)/ http://$1/ [P,E=WHERETO:$1]
ProxyPassReverse /%{ENV:WHERETO}/ http://%{ENV:WHERETO}/
The logical consequence would be for ProxyPass to support that, too. But
since this directive is handled in a different file and I don't know a
centralized place to put the expand_vars() function, I didn't do that.
Feel free to send comments.
Regards
Carsten.
Loading...