Forum Discussion
flefranc_29890
Nimbostratus
Nov 05, 2008http redirection to an IP address of a pool member
Hello,
I want to redirect all http traffic to a VIP address to the IP address of a member of a pool.
I begin like this in a i-rule :
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect http://Pool}
}
It does'nt work ...I don't now how to write the IP address of the pool member chosen at a moment in a load-balancing way.
Sincerely
- hwidjaja_37598
Altostratus
You can use pool command, the help is at: - flefranc_29890
Nimbostratus
Hello, - dennypayne
Employee
Just create another pool with only the member you want in it and use the pool command to select that one. - hoolio
Cirrostratus
If you really want to redirect the client to the selected pool member's IP address, you can use a rule like this (Click here๐when LB_SELECTED { Check if requested URI is / if {[HTTP::uri] eq "/"}{ Send redirect with the selected server's IP address HTTP::redirect "http://[LB::server addr]" } }
- flefranc_29890
Nimbostratus
I try this : - flefranc_29890
Nimbostratus
when i try this : - hoolio
Cirrostratus
Sorry about that. It looks like HTTP:: commands won't work in LB_SELECTED. Else, you should be able to use LB::select to force a pool member selection and then redirect to the selected IP:when HTTP_REQUEST { set pool_info [LB::select] log local0. "The LB choice is: $pool_info. Redirecting to http://[getfield $pool_info " " 4]" Redirect to selected pool member's IP address HTTP::redirect "http://[getfield $pool_info " " 4]" }
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