Forum Discussion
John_Fretwell_1
Nov 06, 2006Historic F5 Account
L4 TCP redirect to simulate HTTP redirect
I have a requirement for a v9.2.3 Link Controller (no L7 iRules or HTTP redirect within the http profile) to be able to redirect to a holding page when all pool members are down.
Below is the iRule I have written, however, the BIG-IP resets the connection and the redirect is never acheived. Is it possible to construct a successful http redirect at layer 4?
Many thanks.
My last attempt was ...
when CLIENT_ACCEPTED {
if {[active_members pool_80]< 1}{
TCP::respond "HTTP/1.0 302 Found\r\n Response code: 302\r\n Server: BIG-IP\r\n Location: http://holdingpage.domain.com\r\n Connection: close\r\n\r\n"
TCP::close
return}
}
- alistair_carneg
Nimbostratus
The problem is that the units are only running LC and not the full LTM software. The fallback host used to be available in ver 4.5 LC but seems to have disapeared in version 9. - hoolio
Cirrostratus
If the connection is being reset, there should be an error in the /var/log/ltm log file. Can you post that here? - John_Fretwell_1Historic F5 AccountI has some more time today to debug my iRule. It turns out that spaces are critical in the tcp response if it is to be interpreted as an http response. The working iRule is:
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