Forum Discussion

1 Reply

  • It appears, for POST request you want uri rewrite, where first uri path would be same, trimming anything after it and adding some other static URI path but not from the request itself? Also, this doesn't appear to be redirect but sending to pool (or node) on the same LTM? Please note, HTTP POST method doesn't follow a redirect.

     

    If yes for all above, you can try the below code.

     

    	when HTTP_REQUEST {
    		switch -glob [string tolower [HTTP::uri]] {
    			"/aa*"
    		   {
    			  if { [HTTP::method] eq "POST" } { 
    			  set first_uri  [lindex [split [HTTP::uri] "/"] 1]
    			  set new_uri /$first_uri/YY/ZZ
    			  HTTP::uri $new_uri
    			  pool p_10008
    			  } else {
    			  pool x_10004
    			  }		  
    			}
    			default {
    			   return
    		  }
    	   }
       }