Forum Discussion
JustinS_88353
Oct 15, 2010Nimbostratus
Irule help 302 + maintain URI
I've got a high bandwidth application where I want to use the F5 to monitor a pool of available servers and send requests to them. However, I want to use a 302 redirect (or something else if you know...
Ben_95489
Oct 15, 2010Nimbostratus
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
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