iRule to re-direct a persistent failed node to a "sorry" page
We have an application which is load balanced to one of two nodes using the HTTP cookie Insert persistence method when the customer logs on to the application (that is, all the traffic will then go to this node). What we want to happen is if the node which the customers are logged into fails, the next requests that the customer makes re-directs them to a different page which says something bad has happened (a "sorry" page) and they need to login again (which will be on the other node). Is there a sample iRule which can do this? Appreciate all help.
You shouldn't need an irule to do this. If they are persisting to a failed node this is because either there is no Monitor on the pool, or because of the Pool setting "Action On Service Down":
https://support.f5.com/kb/en-us/solutions/public/15000/000/sol15095.html
which from your description should be set to Reselect. Look in your Pool -> Advanced.
Also, of interest is the HTTP profile setting "Fallback Host", which allows you to redirect to an external page when the whole pool fails: