Forum Discussion
URL redirection
Hi,
URl3https://uatservices.goindigo.in should be redirectd both servers like 1.2.3.4 and 1.2.3.5 but below urls should be redirected to the only one pool member 1.2.3.4
https://uatservices.goindigo.in/PassengerManifest
https://uatservices.goindigo.in/RevenueExtraction/
https://uatservices.goindigo.in/IflyTraining/
https://uatservices.goindigo.in/AgentPortal/
https://uatservices.goindigo.in/AmountReconcilation/
https://uatservices.goindigo.in/AuditPortal/pages/frmLogin.aspx
https://uatservices.goindigo.in/HR-Exams/
https://uatservices.goindigo.in/IndigoCreditAccount/
https://uatservices.goindigo.in/LegalTracker/
https://uatservices.goindigo.in/FinApp/
https://uatservices.goindigo.in/WelcomeSMS/
Pls. let us know how we can do that ?
3 Replies
- Josiah_39459Historic F5 Account
Check out the example irules here:
https://devcentral.f5.com/wiki/iRules.pool.ashx
especially this one seems exactly like what you want to do
--
when HTTP_REQUEST { if { [HTTP::uri] ends_with ".gif" } { if { [LB::status pool my_Pool member 10.1.2.200 80] eq "down" } { log "Server $ip $port down!" pool fallback_Pool } else { pool my_Pool member 10.1.2.200 80 } } }--
- Anuj_Chaudhary_
Nimbostratus
My backend servers are 172.23.100.11 and 172.23.100.12 Uatservices.goindigo.in should go. To both servers..rest URLs should go nly 172.19.100.11..how will be the irule ? Can we include all poinintg URLs word in one irule ???
- lunitic_56137
Nimbostratus
With that many URI's you may want to use a switch statement. The base URL with no URI would end up being the last matching statement.
https://devcentral.f5.com/questions/host-with-multiple-uri
when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "*/uri-1/*" - "*/uri-2/*" { HTTP::redirect "https://www.mysite.com[HTTP::uri]" or use: pool my_pool-1 return } "*/uri-3/*" { pool my_pool-2 return } } default { if {[string tolower [HTTP::uri]] equals "/"} { HTTP::redirect "https://www.myothersite.com[HTTP::uri]" return } } }HTH,
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