HTTPS Response variable

Hi,

I want to set some responses in order that I can set HTTPS via HHTP stream, Could anyone comment if the below syntax is correct for setting HTTPS variables for responses ?

set xxx_response_body
            {
            http://abc.com====https://abc.com
            http://abc.com:80====https://abc.com
            http&====https&
            }

If I understand you correctly you want to redirect the clients connecting on HTTP to HTTPS instead? There is actually a system-supplied iRule that does just that. I don’t remember the exact name but when you look at the system supplied iRules it will be fairly obvious which one is the right on. Hope that helps.

Please try this iRule…

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

You’re probably better off with a STREAM profile and iRule:

when HTTP_REQUEST {    
    STREAM::disable        
    HTTP::header remove Accept-Encoding        
}    
when HTTP_RESPONSE {    
    if { [HTTP::header Content-Type] contains "text" } {
        STREAM::expression {@http://@https://@}
        STREAM::enable            
    }        
}

So instead of maintaining two VIPs (one HTTP and one HTTPS) and redirecting every HTTP request to the HTTPS VIP, a STREAM iRule will simply replace all references to http:// URLs in the response HTML payload.