For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Richard_The_203's avatar
Richard_The_203
Icon for Nimbostratus rankNimbostratus
Jun 25, 2015

URI Rewrite without Redirection

Hi,

I have an NGINX rule that needs to be translated to the equivalent iRules:

rewrite /api/user.getInfo.(.*) /api/user/getInfo.$1 last;

And this is the iRules I came up with:

 

"/api/user.getInfo.*" 
{
  scan [HTTP::uri] {/api/user.getInfo.%[^.]+} cap1
  HTTP::uri /api/user/getInfo.$cap1
}

 

It does the URI transformation correctly; however, I get HTTP/1.1 302 Found back from it. Is there a way to perform a URI rewrite without returning 301/302 (redirection) status code on F5?

Thank you!

3 Replies

  • giltjr's avatar
    giltjr
    Icon for Nimbostratus rankNimbostratus

    Is the F5 returning the 301/302 or is server behind the F5 returning the 301/302 and the F5 is just passing it along?

     

  • Thank you for the verification!

    Apparently, it was my server from the default_pool that was returning 302 like you guys said. Specifying the pool in the iRule block fixed the issue.

     

    "/api/user.getInfo.*" 
    {
      scan [HTTP::uri] {/api/user.getInfo.%[^.]+} cap1
      HTTP::uri /api/user/getInfo.$cap1
      pool my_api_pool
    }