Forum Discussion
neptunepisces31
Nimbostratus
May 13, 2020F5 iRule Task
Can someone explain how this would be done?
- cjunior
Nacreous
Hello,
Perhaps this example will cover your needs:
when HTTP_REQUEST { set uri [HTTP::uri] if { [HTTP::path] starts_with "/accounting" } { pool accounting_servers } elseif { [info exists goto_legacy] } { unset goto_legacy pool legacy_servers } else { pool responsive_servers } } when LB_SELECTED { log local0. "URI: $uri | Selected pool: [LB::server pool]" } when HTTP_RESPONSE { if { [HTTP::status] eq 404 } { if { [LB::server pool] ends_with "responsive_servers" } { set goto_legacy 1 HTTP::respond 302 -version auto noserver Location $uri X-Retry-Response 404 } } }
It flags a variable on failed attempt to responsive servers and then redirect to new attempt on legacy servers using the same connection.
Maybe that helps but I don't know it's the best thing to do. (But I can't think of another 😕 )
Please, tell me if it solves or there are a better solution.
Kind regards.
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