Forum Discussion

TridipLenka_316's avatar
TridipLenka_316
Icon for Nimbostratus rankNimbostratus
May 29, 2017

How to re-direct the VIP traffic to specific directory of back-end server

The VIP : https://abc.com

 

its pool members are : 10.2.3.2:2001 10.2.3.3:2001

 

Both the backened servers have webpage configured with extension which is accessible only when accessed as : https://10.2.3.2:2001/etc/del

 

And doesn't reply only with : https://10.2.3.2:2001

 

Now how should i configure irule in VIP. So that when it starts the connection to backened server with extension. Or is there a way in server end that whenever a request come for https://10.2.3.2:2001 it auto redirects to https://10.2.3.2:2001/etc/del .

 

6 Replies

  • M_2's avatar
    M_2
    Icon for Altocumulus rankAltocumulus

    can you try the below irule.

    when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] equals "abc.com" } {
        if { [string tolower [HTTP::uri]] equals "/" } {
            HTTP::respond 302 noserver Location "http://[getfield [HTTP::host] : 1]/etc/del"
        } else {
            pool mypool.pool
    
        }
    }
    }
    
  • Anesh's avatar
    Anesh
    Icon for Cirrostratus rankCirrostratus
    • Are you offloading SSL traffic?
    • Are you using an http profile and ClientSSL profile?
    • Can you provide your VIP configuration?
  • Anesh's avatar
    Anesh
    Icon for Cirrostratus rankCirrostratus

    try below , also tail -f /var/log/ltm when sending request to vip

    when HTTP_REQUEST {
       if { (([HTTP::host] equals "abc.com") or ([HTTP::host] equals "www.abc.com")) } {
           log local0. "host match"
           if { [HTTP::uri] equals "/" } {
           log local0. "uri match"
           HTTP::redirect "https://[LB::server addr]:2001/etc/del"
           }
         }
       }