Forum Discussion
HTTP:: redirection is not working in iRule
I am using 443 VIP with SSL offloading/http profle enabled. It matches all the conditions in the below irule except http::redirect condition.
could you please let me know what is the reason why the redirection is not working on iRule ?
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "x.y.com" } { pool x-pool } elseif { [string tolower [HTTP::host]] equals "xdev.y.com" } { pool xdev-pool } elseif { [string tolower [HTTP::host]] equals "xuat.y.com" } { pool xuat-pool } else { HTTP::redirect http://1.1.1.1:65535/ } }
Any help would be highly appreciated !
2 Replies
- nitass
Employee
It matches all the conditions in the below irule except http::redirect condition.
what host (fqdn) did you test?
configuration [root@ve11a:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "x.y.com" } { pool x-pool } elseif { [string tolower [HTTP::host]] equals "xdev.y.com" } { pool xdev-pool } elseif { [string tolower [HTTP::host]] equals "xuat.y.com" } { pool xuat-pool } else { HTTP::redirect http://1.1.1.1:65535/ } } } test [root@ve11a:Active:In Sync] config curl -I http://172.28.24.10 -H "Host: something" HTTP/1.0 302 Found Location: http://1.1.1.1:65535/ Server: BigIP Connection: Keep-Alive Content-Length: 0 - nitass
Employee
Requirement : The condition is if all pools are down, it should redirect to server Maintenance page
the irule does not match the requirement (i.e. it does redirect when fqdn does not match predefined names). you can use active_members to check number of active pool members.
active_members https://devcentral.f5.com/wiki/iRules.active_members.ashx
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