Forum Discussion
Wynand_van_Nisp
Nimbostratus
Sep 12, 2006Change URI after evaluation and still load balance
Hi everyone,
I have a customer with a strange request. The want to specify in the URI which pool to use, then strip the part that identify it and continue with the load balance. My irules are not up to scratch yet and I have done this so far but get stuck on the removal of the "prd/" and "ppd".
Any help will be appreciated.
---- snip ----
when HTTP_REQUEST {
if {[HTTP::host] contains "soa"} {
if {[HTTP::uri] starts_with "/prd/"} {
Remove prd/ here
pool POOL_SOA_PRD
}
if {[HTTP::uri] starts_with "/ppd/"} {
Remove pPd/ here
pool POOL_SOA_PPD
}
else {
THIS IS ONLY HERE SO THAT THEY CAN KEEP TESTING
pool POOL_SOA_PRD
}
}
}
Thanks in advanced.
Wynand
- Colin_Walker_12Historic F5 AccountYou could do this a couple of different ways. One way you might try is with the string trim left command.
when HTTP_REQUEST { if {[HTTP::host] contains "soa"} { if {[HTTP::uri] starts_with "/prd/"} { HTTP::uri [string trimleft [HTTP::uri] /prd] pool POOL_SOA_PRD } if {[HTTP::uri] starts_with "/ppd/"} { HTTP::uri [string trimleft [HTTP::uri] /ppd] pool POOL_SOA_PPD } else { THIS IS ONLY HERE SO THAT THEY CAN KEEP TESTING pool POOL_SOA_PRD } } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects