Forum Discussion
Scott_Hopkins
Jun 03, 2015Nimbostratus
Make sure you have oneconnect on for your virtual server. If not, it will only make a load balancing decision on the first message on a connection.
The iRule looks fairly good (although try to wrap in in a code block to display a little cleaner). This is a proper use of switch over if statements, although you may want to switch to [HTTP::Path] and wrap the HTTP::uri/path with a [string tolower] block to make sure case issues don't bugger this up. You may also want to look at the ProxyPass iRule for something that does this out of the box.
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/ent-inventory-services" { pool pools_sss_dev_8443 }
"/ent-customer-services" { pool pools_sss_dev_8443 }
"/ent-security-services" { pool pools_sss_dev_8443 }
"/ent-payment-services" { pool pools_sss_dev_8443 }
"/ent-agreement-services" { pool pools_sss_dev_8443 }
"/ent-misc-services" { pool pools_sss_dev_8443 }
"/ent-ht-services" { pool pools_sss_dev_8444 }
"/customer" { pool pools_sss_dev_8445 }
"/inventory*" { pool pools_sss_dev_8445 }
"/agreements" { pool pools_sss_dev_8445 }
"/ent-exception-services" { pool pools_sss_dev_8445 }
"/payment" { pool pools_sss_dev_8445 }
"/ent-report-services" { pool pools_sss_dev_8445 }
default { Default - not matching any URI pool pools_sss_dev_default }
}
}