Forum Discussion

Paul_Dawson_103's avatar
Paul_Dawson_103
Icon for Nimbostratus rankNimbostratus
Mar 01, 2006

stream profile + http profile

Probably not directly related to iRules but is there any reason why the stream profile does not work in combination with the http profile under the VS?

 

 

Just thought I'd mention it here for future search purposes because it's just taken me a day to figure out why the stream profile wasn't working.

 

 

 

--

 

Paul

4 Replies

  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    You are going to have to be more specific than that. What's not working?

     

     

    I know this is a bit of a shot in the dark, but if you are having trouble with content length not being updated, make sure the http profile 'response chunking' is set to 'rechunk'.

     

     

    What version of the BigIP are you running?
  • Sure thing:

     

     

    Version 9.2.2

     

     

    The stream profile is as basic as it gets.

     

     

    Source : http://

     

    Target : https://

     

     

    (rewriting the server response)

     

     

    Terminating client SSL on the VS with clear text to the backend server. That's pretty much it.

     

     

    Enabled http profile on the VS causes the stream profile to stop working i.e http:// is passed back to the client.

     

     

     

    Disabling the http profile causes it to work.

     

     

     

     

  • I have just observed the same behavior. I have a very simple substitution in the stream profile:

     

     

    Source: servername:portnum

     

    Target: servername

     

     

    The stream profile seems to fire only when there is no http profile applied to the virtual server.

     

     

    I am running v9.2.3. Any ideas?

     

     

    Thanks!

     

     

    -k
  • Hello,

    With no HTTP profile, the stream profile will be applied against the full TCP payload (ie, the HTTP headers and HTTP payload). When you add an HTTP profile, LTM parses the HTTP headers and only applies the stream profile against the HTTP payload. SOL8115 (Click here) has additional detail on this.

    I would guess the replacement you're trying to perform is in an HTTP header. If so, and you want to apply an HTTP profile to the VIP, you can use the HTTP::header replace command (Click here) to perform the replacement.

    If the replacement is in the Location header in a redirect, you can use this rule with an HTTP profile:

    
    when HTTP_RESPONSE {
        Check if the response is a redirect
       if {[HTTP::is_redirect]}{
           Replace servername:portnum with servername in the Location header
          HTTP::header replace Location [string map {servername:portnum servername} [HTTP::header value Location]]
       }
    }

    If you have additional strings in the HTTP payload that you want to replace, it is more efficient to use a blank stream profile and an iRule to perform the HTTP payload replacements. To do so, you can use the STREAM::expression command (Click here). There's an example on the wiki page for the syntax.

    Aaron