Forum Discussion
redirect to a pool for multiple uri
Yes, you can do that provided the logic is correct
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]"
} elseif { [HTTP::path] equals "xxx" } {
pool XXXXX
}
}
- dracoMar 28, 2017
Nimbostratus
Hey Kunjan
Can you see any error in this code ?
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 } } } - JinshuMar 28, 2017
Cirrus
It would be easy to read if you can format (select the irule and Ctrl+K) this irule, Divya.
-Jinshu
- dracoMar 28, 2017
Nimbostratus
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' - JinshuMar 28, 2017
Cirrus
Hi Divya,
Have you tried the irule provided by Kunjan?
-Jinshu
- dracoMar 28, 2017
Nimbostratus
no jinshu, i had googled and saw people suggesting to use 'switch' instead . in this below url:-
 
https://devcentral.f5.com/s/feed/0D51T00006i7R59SAE
 
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.
 
- JinshuMar 28, 2017
Cirrus
Hi Divya,
You have added options after "/bimiddleware/*" which doesnt required. Try below modified irule.
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 } } }-Jinshu
- dracoMar 29, 2017
Nimbostratus
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 ?
- JinshuMar 29, 2017
Cirrus
Hi Divya,
Glad that this got worked finally.
You can use [TCP:local_port] syntax for port based conditions.
-Jinshu
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com