Forum Discussion

PSPK's avatar
PSPK
Icon for Nimbostratus rankNimbostratus
Jul 25, 2017

HTTP Post - Redirect

I have a client(browser) requesting an HTTP post request to a VIP-1.

 

This POST request should be redirected to VIP-2 with the help of an irule.

 

Can this is be done?

 

Please help

 

3 Replies

  • Do you want an explicit redirect, where an HTTP 3xx response is sent back to the client, or do you want to transparently forward from one Virtual Server to a different Virtual Server?

     

  • You can use a response code 307 for that, i.e.

     

    when HTTP_REQUEST {
        if {}{
            HTTP::respond 307 noserver Location "https://your.new.location/page"
        }
    }
  • Hello PSPK,

    Try this irule. Apply it to VIP 1

    when HTTP_REQUEST {
    
        First identify the POST you may add more condition to identify your particular POST 
        if { [string tolower [HTTP::method]] eq "post" } {
            Redirect the post to the other VS, replace vs-name-vip2 by the VIP 2 VS name         
            virtual vs-name-vip2
        }
    }