[Techtalk] apache mod_proxy access

Kristina Clair kclair at karl.serve.com
Fri Apr 9 11:31:00 EST 2004


 Hi All,
 
 I am trying to find a solution that will allow me to limit access to a
 proxied location based on the full request URL, and it is proving to be
 very frustrating.
 
 We are using ProxyPass and ProxyPassReverse for the proxying:
 ProxyPass /proxy_me http://internal.server/
 ProxyPassReverse /proxy_me http://internal.server/
 
 The issue is that I only want access to be granted on the internal
 server if the following regular expression is true:
 ^http://([^\/]+)/proxy_me/\1\/?   (matched against the requested URL)
 
 I have tried various methods:
 
 - using mod_rewrite on the internal server: the problem with this is
 that I cannot find an environment variable that mod_rewrite can use that
 contains the whole URL request string.   I also tried the following:
 	RewriteCond %{HTTP_HOST} !^http://$1 [NC]
 	RewriteRule /proxy_me/([^\/]+) - [F]
 but as far as I can tell, that $1 in the regex doesn't contain what I
 think it should.
 I wonder if I am missing something about this approach?
 
 - using SetEnvIf and <Directory proxy:*> on the proxying server.  Again,
 the problem is that I cannot find an environment variable that I can use
 in SetEnvIf that will allow me to test what I need to.
 
 So I'm about to give up, but I thought maybe people on this list with
 more experience with Apache and proxying might have some creative
 solutions!
 
 Thanks,
 Kristina



More information about the Techtalk mailing list