Forum Discussion

Rusty_Hale_8009's avatar
Rusty_Hale_8009
Icon for Nimbostratus rankNimbostratus
Sep 11, 2006

Is this possible with an iRule?

if the URL contains the components in the second column below, the URL up to and including the 2nd column's keyword gets rewritten to be the third column. So

 

 

http://old.abc.com/OA_HTML/some/interesting/document.html

 

 

would become

 

 

http://new.web.com:10125/OA_HTML/some/interesting/document.html

 

 

and then it gets shipped out of the apache server's LAN interface where it travels to the Oracle apps tier. The connection to the web browser stays open, and when the response returns from the apps it is rewritten back to what it was and shipped back to the browser, then the connection to the browser is closed.

6 Replies

  • I blogged about this a long time ago. This should lead you in the right direction.

     

     

     

    iRule: modify uri and response

     

    http://devcentral.f5.com/weblogs/joe/archive/2005/07/27/1398.aspx

     

    Click here

     

     

    -Joe
  • Joe, Thanks a million. I appreciate the quick response. Will post results of what I am trying to do. Great help.
  • Joe, I made one small change to the requirements that may or may not break your solution.

     

     

    https://old.abc.com/OA_HTML/some/interesting/document.html

     

     

    would become

     

     

    http://new.web.com:10125/OA_HTML/some/interesting/document.html

     

     

    Does going from https to http then back to https change how the iRule will function or is it all the same?
  • As long as you are having the BIG-IP do the SSL termination for your backend servers, then there shouldn't be a problem. the protocol portion of the URL isn't passed as part of the HTTP request, it is determined by how the web servers is configured on the given port.

     

     

    For the response, it's just string replacement, so there shouldn't be a problem. BTW, for the response, you could probably get away with using a Stream profile and a simple string replacement. Since it is a basic string map on the response ("http://new.web.com:10125" to "https://old.abc.com") you could specify those values in your stream profile parameter.

     

     

    -Joe
  • Do anyone have a code snippet on an https request be redirected to the normal http requets.

     

     

    Thanks!

     

     

    Regards,

     

    TRX
  • Hi TRX,

    As Joe mentioned, once the SSL has been decrypted on LTM, you can issue a redirect to http or https the same way, regardless of whether the clientside connection was over SSL or clear. This example would redirect all requests to the URL listed:

     
     when HTTP_REQUEST { 
      
         Send a 302 redirect to the client 
        HTTP::redirect "http://www.example.com/new_uri.html" 
     } 
     

    Aaron

    Aaron