HTTP_POST_ Redirect

Problem this snippet solves:

This is when client send a POST request to LTM and you want to redirect client to another url. Also, you want client to still submit POST request automatically with same POST data to new url.

Code :

when RULE_INIT {
    set static::ext_url "http://10.10.71.3/test.post"
}
when HTTP_REQUEST {
        
    if { [HTTP::method] eq "POST" } {
        HTTP::collect [HTTP::header "Content-Length"]
    }    
}
when HTTP_REQUEST_DATA {
    set content "
Published Mar 18, 2015
Version 1.0
No CommentsBe the first to comment