AllanUK_202329
Jan 12, 2017Nimbostratus
iRule for subdomain datagroup matching
Hi,
I have been trying to find a solution to my requirement below,
We have subdomains like subdomain.domain.com and we want to perform a match on the domain part in a data group to return a pool and ideally an SSL profile.
For the pool part I think it should go something like this;
when HTTP_REQUEST {
set DATA_GROUP_HTTPSPOOL $::DG-HTTPSPool
set HOST [string tolower [HTTP::host]]
set POOL [ findclass $HOST $DATA_GROUP_HTTPSPOOL " " ]
if { $POOL ne "" } {
pool $POOL
}
}
This would be with a datagroup as follows;
ltm data-group internal /Common/DG-HTTPSPool {
records {
domain.com {
data "pool-domain.com"
}
}
type string
}
I don't know how close this is to being correct or if what I'm trying to do is even possible. So any advice would be gratefully received.
I think i really need to use an
match ending_with
rather than the findclass
but I'm not sure. Also i don't know the best way to do the profile would it also sit under the when HTTP_REQUEST
?
Many thanks,
Allan