I have multiple sites and each site uses multiple uri’s , so i need to redirect to a particular pool based on the uri’s .Like if its /index.html or /benefits or /analytics → it should direct the traffic to service on port 9797 .
will the below work ?
when HTTP_REQUEST {
log local0. “BI request received” if { [HTTP::path] equals “/index.html” || [HTTP::path] equals “/benefits” || [HTTP::path] equals “analytics” || [HTTP::path] equals “/bicomposer”} { log local0. “BI request for BI service received. Selecting end server” pool OHS_BI_9797 log local0. “BI end server selected: [IP::server_addr]” }
There are other pools also to be redirect to based on to other uri’s which i could mention as an else statement ?
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/index.html" -
"/benefits/*" -
"/analytics/*" -
"/xmlpserver/*" -
"/ui*" -
"/mapviewer/*" -
"/bicomposer*" -
"/bisearch/*" -
"/console/*" -
"/biacm/*" -
"/bimiddleware/*" -
{
/ URI b URI
pool URI_b_pool
}
default {
non-/site a URI
pool URI_default_pool
}
}
}
sorry, didnt see that...i get error at 'default'
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/index.html" -
"/benefits/*" -
"/analytics/*" -
"/xmlpserver/*" -
"/ui*" -
"/mapviewer/*" -
"/bicomposer*" -
"/bisearch/*" -
"/console/*" -
"/biacm/*" -
"/bimiddleware/*" -
{
/ URI b URI
pool URI_b_pool
}
default {
non-/site a URI
pool URI_default_pool
}
}
}
sorry, didnt see that...i get error at 'default'
So i felt, this one is more efficient for my scenario.I will give the other code also a try and see. But if possible do let me know what could be wrong in this.
So i felt, this one is more efficient for my scenario.I will give the other code also a try and see. But if possible do let me know what could be wrong in this.
Thank you jinshu …switch statement wasnt working as was required , so tried with if elseif, its working. I have one more question, can i under http request event , check if the server port is 7777 and uri is something specific and then redirect accordingly ?
Thank you jinshu …switch statement wasnt working as was required , so tried with if elseif, its working. I have one more question, can i under http request event , check if the server port is 7777 and uri is something specific and then redirect accordingly ?