Hey Justin,
If I understand you correctly, I think you're looking to effectively outsource the load balancing to the LTM but not have it handle all of the traffic processing. I think that doing this at HTTP_REQUEST rather than HTTP_RESPONSE is probably what you want to do. The HTTP_RESPONSE event means that the request has already been sent to the server and a response has come back. It sounds like you want to avoid this in general. To Chris's point, though, the HTTP::redirect does freak out a little bit in the wrong events. I think your original rule works in very basic structure, but you probably want to use the HTTP::redirect command instead of the respond command (
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__redirect.html ).
Something, then, like this:
when HTTP_REQUEST {
switch [LB::select] {
"10.1.1.1." {
HTTP::redirect "http://10.1.1.1[HTTP::uri]"
}
"10.1.1.2." {
HTTP::redirect "http://10.1.1.2[HTTP::uri]"
}
"10.1.1.3." {
HTTP::redirect "http://10.1.1.3[HTTP::uri]"
}
}
I'm not sure this will work exactly, I would have to play with it a bit to see. I also think that you could save yourself the trouble of the switch statement by doing something like this (again, completely untested):
when HTTP_REQUEST {
HTTP::redirect "http://[LB::select][HTTP::uri]"
}
Hope this helps!
\\ Ben