Forum Discussion

cgwin12's avatar
cgwin12
Icon for Altocumulus rankAltocumulus
Jan 05, 2026
Solved

error code 503 redirect irule

Hello, I want to create a logical path in F5 where if one server pool is down, we get an error code 503, then a redirect happens to a second pool. This is what I have written, but does not seem to re...
  • cgwin12's avatar
    Jan 08, 2026

    Injeyan, thanks for reaching out with your help. I wanted to share that we got this to work and I wanted to show how. 

     

    I applied this i-rule intially; 

     

    when HTTP_REQUEST {

    if { [HTTP::uri] contains "/pssmetrics" }{

    pool web-lb-dev-f5-ssl-pool2

    } else {

    pool web-lb-dev-f5-ssl-pool

    }

    }

    That specifies I want that uri to go to pool2. In pool 2 I have server 1 and server 2. Pool (1) only has server 1. Within pool2, I have a custom healh monitor, and when you mentioned a health monitor, that got me thinking along that track. Within the custom monitor, the pool member with the active service for pssmetrics will get the traffic load balanced to it, the condition being anytime there is a 503 error code. 

     

    So as  follows; 

    Send String:

    GET /pssmetrics HTTP/1.1\r\nHost: webfrontendalias.domain.org\r\nConnection: Close\r\n\r\n

    Receive String:

    302 

    (No OK after this, the regex gets cranky)

     

    Receive Disable Strng:

     

    503