Forum Discussion

jack_10574's avatar
jack_10574
Icon for Nimbostratus rankNimbostratus
Sep 16, 2014

Forward the request to specific pool url

Hi all

 

i have a requirement during maintenance window , it need to have an irule with when having http request to the https://www.test.com/abc and http://www.test.com/def

 

F5 will forward the request to the pool member 10.1.1.1/maintenance.html

 

Base on the requirement, F5 must send the request to pool member specific path which is /maintenance.html

 

Can anyone guide and let me know how can i write an irule to achieve the above requirement ?

 

Your advice is much appreciate

 

1 Reply

  • Hi Jack,

    You will find below the iRule you need :

    when HTTP_REQUEST {
        if {[string tolower [HTTP::host]] equals "www.test.com"}{
            if {([string tolower [HTTP::uri]] starts_with "/abs") or ([string tolower [HTTP::uri]] starts_with "/def")}{
                HTTP::uri /maintenance.html
                pool poolname member 10.1.1.1 80
            }
        }
    }
    

    You have to replace pool name value with the good one, it should work as you expected.