Forum Discussion

A_Cline_27195's avatar
A_Cline_27195
Icon for Nimbostratus rankNimbostratus
Jan 12, 2006

Changing outgoing HTML with an iRule

I posted this in the wrong area at first. So here goes again...

 

 

I'm so new to BigIP and F5 that it hurts, so please excuse my lack of BigIP/F5 vernacular.

 

 

Application runs on Tomcat.

 

BigIP is our Client SSL endpoint.

 

 

We have a poorly written in-house application that sends out a HTML page with a badly formed definition on all its pages. The BASE HREF tells the client that all connections come from HTTP rather than HTTPS. Is there someway I can use an iRule to "Search and Replace" outgoing HTML and change any references to 'http://' to 'https://'?

 

 

I know this is ugly, but I'm wondering if its possible and hopefully get some newbie-type pointers to get me going.

 

 

Thanks,

 

 

Aaron
  • If all you want to do is to replace "http://" with "https://" in your response data, then it's fairly easy to do. A regsub call would be the easiest to code but probably the worst performance wise.

     

     

    Check out this blog entry I posted a while ago. In it, the request is modified, but content within the response is modified as well. All you'll have to do is to code the HTTP_RESPONSE and HTTP_RESPONSE_DATA events, change the "find" and "replace" strings from "http://" and "https://" and you should be set.

     

     

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

     

    Click here

     

     

    Let us know how this works out for you...

     

     

    -Joe
  • I looked at this last night from home with the intent of revisiting it this morning. Now it appears the server with the link is down. Do you have any idea if it will be coming back soon?

     

     

    Thanks.

     

     

    Aaron