Forum Discussion
Aidan_Carty_242
Nimbostratus
Jan 31, 2006Loadbalance redirects
Were migrating an internet application behind a BIGIP,
it has specfic url requirements so we have a simple iRule on a virtual server, all working fine.
rule redirect_to_webservers {
when HTTP_REQUEST {
HTTP::redirect https://www1.server.com
}
}
But this is putting a load on www1 server, would like todo the following
rule redirect_to_webserver {
when HTTP_REQUEST {
Pick a server 1 2 or 3 then {
case 1
HTTP::redirect https://www1.server.com
case 2
HTTP::redirect https://www2.server.com
case 3
HTTP::redirect https://www3.server.com
}
}
}
Can't figure out how i would make the iRule pick a server, something simple would do or maybe generate a random value based on the clients ip or date/time, then use this value to pick a server.
Any ideas ?
- Colin_Walker_12Historic F5 AccountWell, my first recommendation, if it's possible, would be to create a pool with the three systems in it, and just let BIG-IP load balance normally to that pool. You wouldn't need an iRule at all for this.
when RULE_INIT { set ::n 1 } when HTTP_REQUEST { if { $::n >= 4 } { set n 1 } HTTP::redirect "https://www$n.server.com" incr ::n }
- unRuleY_95363Historic F5 AccountBTW, you probably want a :: in front of n, so that it is in the global namespace.
- Aidan_Carty_242
Nimbostratus
Thanks Guys, see the below rule we put together... - Colin_Walker_12Historic F5 AccountNice work! I always enjoy seeing the result of the discussions here on DevCentral. Thanks for taking the time to come back and post your rule, it's much appreciated!
- Flavien_Vincent
Nimbostratus
Hello everyone. - Deb_Allen_18Historic F5 AccountYou are correct that FTP will not function properly within an HTTP virtual server.
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