Forum Discussion
kunjan_118660
Cumulonimbus
that for example /legal-documents/ is defined in the data group list to (as it should) to point to the alternate pool but the URI /legal-documents/insurance needs to point to the default pool.
I think "starts_with" is the one which is failing here. You can have the original logic but change "starts_with" to "contains". But your dgl shouldn't have the end forward slash. Or if really wants the first if clause to remain, do a "return" so that next following if clause doesn't execute.
JeffM
Oct 25, 2014Nimbostratus
I did change the starts_with to contains but also had to do a re-write from if/if to elseif statements to trigger script exits upon successful match. This iRule is working. Thank you for your responses.
when HTTP_REQUEST {
if { ( [HTTP::uri] contains "/legal/documents" ) } {
pool pool_host.domain.com_80
} elseif { ( [HTTP::uri] contains "/legal-notices/documents" ) } {
pool pool_host.domain.com_80
} elseif { ( [HTTP::uri] contains "/legal-families/document-library" ) } {
pool pool_host.domain.com_80
} elseif { ( [HTTP::uri] contains "/legal-producer/document-library" ) } {
pool pool_host.domain.com_80
} elseif { ( [HTTP::uri] contains "/producer/document-library" ) } {
pool pool_host.domain.com_80
} elseif { ( [HTTP::uri] equals "/" ) or ( [class match [string tolower [HTTP::uri]] contains dgl_host.domain.com_80] ) } {
pool pool_ALThost.domain.com_80
} else {
pool pool_host.domain.com_80
}
}