Forum Discussion

bluestar007_339's avatar
bluestar007_339
Icon for Nimbostratus rankNimbostratus
Dec 03, 2017

irule help

1 ) when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }

 

2)

 

when HTTP_REQUEST { STREAM::disable log local0. "Stream disable request" HTTP::header remove Accept-Encoding }

 

when HTTP_RESPONSE { STREAM::disable if { [HTTP::header value Content-Type] contains "text" } { log local0. "Stream enable" STREAM::expression { @@ } STREAM::enable } }

 

Q) In plain english what is the meaning or functions of the above i rules ? What does the stream do here

 

Q) Where do we attach the above rules ( https or http virtual servers )

 

Thanks

 

1 Reply

    1. Simple redirect from http to https while keeping original requested host and uri.

       

    2. In the request removes a header named Accept-Encoding. In the response if header named Content-Type contains the string “text” in it enables stream to replace all http:// with https:// in the HTTP payload.

       

    Stream is a basic search and replace, the expression is @find@replace@ and you can have multiple if required.