You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by al...@muly.dk on 2005/08/30 09:40:01 UTC

[users@httpd] environment variable lost via location (mod_rewrite)

hi,

[apache 2.0.54]

i'm trying to forward an ssl client cert environment variable via a 
requestheader to a backend reversed proxied machine.
it works fine, but i'm only interested in forwarding it if the client 
request comes in at a certain url.


therefore i thought i'd use the location match like this:

	<location login/>
		SSLVerifyClient require 		SSLVerifyDepth  5
	</location>


then the client woukld indeed only be promted for the certificate at 
the location "/login", however then the environemt variable is 
completety lost.
i have tried to move the Location directive around in ssl-conf to no avail.


so my question is: how can i get hold of the ssl environment varibles 
(that i need in my RewiteCond) but only in the case where a client hits 
a uri underneatch "/login"


# this doesn't work
#<location login/>
#	SSLVerifyClient require #	SSLVerifyDepth  5
#</location>

# this works but on *all* URLS
SSLVerifyClient require SSLVerifyDepth  5

RewriteEngine On
RewriteMap canonicalize int:escape
RewriteCond  %{SSL:SSL_CLIENT_CERT} ^.+ [NC]
RewriteRule ^/login - [E=FORWARD_CERT:${canonicalize:%1}]
RequestHeader set MY_HEADER %{FORWARD_CERT}e env=FORWARD_CERT
RewriteRule ^/login	 http://localhost:8080/backend [P,L]


./allan





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