Forum Discussion

moreski_63593's avatar
moreski_63593
Icon for Nimbostratus rankNimbostratus
Oct 10, 2008

http redirect - where's the payload

Hi,

 

I'm sure this will end up proving to be really simple for you (I seem to be failing to manage the search facility with much success (i.e., I have tried searching for tips / solution)).

 

Here is the rule:

 

when HTTP_REQUEST {

 

if {[HTTP::path] eq "/default.asp"}{

 

HTTP::redirect "http://someserververname.xxx/serverServer/XMLservice/Receiver.aspx"

 

}

 

}

 

 

The redirection works fine however, all the data that the client sends with the original request (xml message in this case) is lost. I'm not sure if I’m using the right type of rule of if what I'm trying to achieve is simply not possible (pretty much everything is possible with irules right).

 

 

System info:

 

BIG-IP 9.4.3 Build 1.4 Final

 

 

I do feel a little embarrassment as I have browsed the forum and everyone else’s posts seem to be a lot more interesting and technically challenging than mine. Nevertheless, many thanks in advance for your help...

 

3 Replies

  • Hi Morkeski,

    This is expected. When an HTTP client receives a redirect, it will send a GET request to the new location. The client will not make a POST request and will not do anything with any previous POST data.

    Does someservername.xxx resolve to the VIP? If so, instead of redirecting the client, you could rewrite the URI:

     
     when HTTP_REQUEST { 
        if {[string tolower [HTTP::path]] eq "/default.asp"}{ 
           HTTP::uri "/serverServer/XMLservice/Receiver.aspx" 
        } 
     }  
     

    If this isn't the case, can you elaborate on the scenario?

    Aaron
  • Many thanks for the speed reply. I now fully understand why I was getting the (expected) results. Unfortunately, someservername.xxx does not resolve to the VIP.

     

     

    The scenario:

     

    We have a web application that that has been redesigned and migrated to another cluster of servers. There is another web service application remaining on the old architecture. A greater plan to migrate this app exists, but for now the question was asked: can the load balancer handle it?

     

    i.e., take all the data destined for one URL and give it lock-stock to another.

     

     

    There is no urgency with this (as this may encourage the project to reprioritise the recoding) however, it will be interesting to see if payload redirection can be achieved.

     

  • I don't think there is a way to force the client to make a POST request to a new location. You could modify the URI and then change the destination of the request using the node command (Click here).

     

     

    Or you could modify the response which generates the POST request to point to the correct location. If the response is going through LTM, you could do this with a stream profile and STREAM::expression iRule (Click here).

     

     

    Aaron