Forum Discussion

jondyke_46152's avatar
jondyke_46152
Icon for Nimbostratus rankNimbostratus
Oct 14, 2008

Losing data on redirect irule

I am trying to do a redirect using an irule on one of my virtual servers. However the problem is that the original message is a post rather than a get so when it arrives at the redirected address it is missing the data.

 

 

The irule I am currently using is:-

 

when HTTP_REQUEST {

 

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

 

HTTP::redirect "http://devbis.assureweb.co.uk/QuoteServer/XMLQuoteserver/Receiver.aspx"

 

}

 

}

 

What can I do instead of a redirect to keep the data intact?

5 Replies

  • Hi Jon

     

     

    Take a look at this post for some options:

     

     

    http redirect - where's the payload (Click here)

     

     

    Aaron
  • hmmmm...looks like a similar issue to the other chap only that the it is going to a different VIP. The post is originaly sent to http://publishdev.assureweb.co.uk/default.asp

     

     

    publishdev.assureweb.co.uk resolves to a VIP

     

     

    The post needs to be redirected to

     

     

    http://devbis.assureweb.co.uk/QuoteServer/XMLQuoteserver/Receiver.aspx

     

     

    devbis.assureweb.co.uk is a different VIP on the LTM.
  • Would it work if you rewrote the response which generates the POST request to the correct resource? If so, you could use a stream profile and STREAM::expression iRule.

     

     

    Or you could try using an iRule to rewrite the URI and select the other VIP's pool. This option might be easier, but more confusing for admin's to follow.

     

     

    Aaron
  • Do you know of any examples of rewriting the URI and using another pool I can take a look at?

     

    I think this one may be a bit out of my league....
  • To rewrite the URI in the request, you can use HTTP::uri "/new/uri". To rewrite the URI in a response header, you can use 'HTTP::header replace'. To replace content in the response payload, you can use a stream profile and STREAM::expression based iRule.

     

     

    There are quite a few examples in this forum and the wiki pages for the various commands. If you have a more specific idea of what you want to rewrite and/or try something which doesn't work, reply here and we can give you more detailed suggestions.

     

     

    HTTP::uri (Click here)

     

    HTTP::header (Click here)

     

    STREAM::expression (Click here)

     

    pool (Click here)

     

     

    Aaron