Forum Discussion
Stanislas_Piro2
Apr 19, 2017Cumulonimbus
Hi,
Even if I gave you a solution, I think it is obviously not the best practice. create a pool with pool member is as easy as create a DNS record.
The best solution is still to create pools with same name as host :
tmsh create ltm pool www.company.com monitor tcp members add { www.company.com:443 { fqdn { name www.company.com autopopulate enabled } } }
then, use the following irule:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with http} { HTTP::uri [findstr [HTTP::uri] [HTTP::host] [string length [HTTP::host]]}
if {[catch {pool [getfield [HTTP::host] ":" 1]}]} {
HTTP::redirect "https://www.company.com/"
}
}