Forum Discussion
Irules Data-Group
Hi Sir,
After a long-time, did many tests and finally we have the below:
==================
when CLIENT_ACCEPTED { set default_pool [LB::server pool]
log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" } when HTTP_REQUEST { switch -glob [HTTP::uri] { "/" { log local0. "redirecting from /" HTTP::redirect "http://apbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home"
return pool pool_ctbuild.leni2.com_http } "/iss_static*" { if { [class match [virtual] equals Parveez_Static104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Static104] ","] 1] } else { log local0. "Static pool entry for [virtual] not created yet" reject } return } default { if { [class match [virtual] equals Parveez_Dynamic104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Dynamic104] ","] 0] } else { log local0. "Dynamic pool entry for [virtual] not created yet" reject } return } } }
========================
In the above Irule : as you are aware that we created two Data-Groups Parveez_Static104 and Parveez_Dynamic104 respectively for Static and Dynamic Pools:
Data-Group: Parveez_Static104 and Parveez_Dynamic104 consists of binding of: Virtual-Server:=Pool Name as mentioned below:
-=== b shell class dg_parveez_dynamic_pools { { "apctdev.leni2.com-VS-HTTP" { "pool_apctdev.leni2.com_http" } "apbuild.leni2.com-VS-HTTP" { "pool_apbuild.leni2.com_http" } "apctdev.leni2.com-VS-HTTP" { "pool_apctdev.leni2.com_http" } } }
save
Now Our idea is to add the First part of the Irule also into a 3rd Data-Group: basically link: "http://apbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home" with the Pool name:pool_ctbuild.leni2.com_http)
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/" { log local0. "redirecting from /" HTTP::redirect "http://apbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home"
return pool pool_ctbuild.leni2.com_http
So, how my existing Irule will look like. Kindly suggest.Tring to avoid any kind of 302 redirect, inspite 301 is good and desirable.
Thanks and Regards Parveez
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