Forum Discussion
irule: Members down, select pool and URI
I have an irule that we have used now for some time:
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1} {
snat automap
pool pool_sorry
}
}
This irule works fine, however what I now want to be able to do is sent HTTP requests to a pool / pool member and specific URI when the active_members is <1.
To clarify the new irule would look something like this (syntaxes obviously not correct, but just to get what I am trying to achieve across)
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1} {
snat automap
pool pool_sorry /page1.aspx
}
}
Any ideas would be greatly appreciated, I know I can do a simple HTTP::redirect but I am trying to avoid this.
7 Replies
- What_Lies_Bene1
Cirrostratus
I would have thought this would do it;when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1} { snat automap HTTP::uri "/page1.aspx" pool pool_sorry } } - Kevin_Stewart
Employee
You can use the HTTP::uri command to (re)set the URI:when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1} { snat automap HTTP::uri "/page1.aspx" pool pool_sorry } } - collinz1_17223
Nimbostratus
Thanks for your responses guys, that does indeed achieve what I was after, the only problem I seem to have now is that if the Virtual Server that this rule is associated to is an SSL site the F5 attempts to connect to the “pool_sorry” on port 443, even though the pool member are setup for port 80.
This happens regardless of whether you have an SSL Profile (Server) configured for your normal pool. - Kevin_Stewart
Employee
Do you have port translation disabled in your virtual server configuration? - collinz1_17223
Nimbostratus
Kevin, port translation is enabled in this configuration.
- Kevin_Stewart
Employee
So just to clarify, do you have a server SSL profile assigned to the virtual server? If so you'll need to disable that profile when sending traffic to the port 80 sorry pool.when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1} { snat automap SSL::disable serverside HTTP::uri "/page1.aspx" pool pool_sorry } } - collinz1_17223
Nimbostratus
Thats it thanks for your help on this one :)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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