Matt_108491
Dec 03, 2008Nimbostratus
Some basic iRule questions
I am a little new to irules so I could get some advice I would appriciate it.
I have traffic moving through an F5 LTM and it uses client side authentication.
There is an I rule configured that works as follows
This is existing and seems to work - the idea is to put the cert subject dn into an http header -
when CLIENTSSL_CLIENTCERT {
set subject_dn [X509::subject [SSL::cert 0]]
}
when HTTP_REQUEST {
Insert user header
HTTP::header insert user $subject_dn
set names [HTTP::header names]
foreach name $names {
set val [HTTP::header value $name]
log local0. " $name: $val"
}
}
I would like to do two additonal steps
1. Redirect the request to a new URI IF the URL matches a pattern for example
2. Put the origninal URL and URI in a second head which for the sake of discussion I will call mytarget.
so essentially I am trying to modify the above rule too do the following
if the users goes to *.example.com/ AND the $subject_dn is populated
send them store *.example.com/ in a header and redirect them to the same *.example.com/redirect