Forum Discussion
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&
}
3 Replies
- Henrik_Gyllkran
Nimbostratus
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.
- Antony2015
Altostratus
Please try this iRule...
when HTTP_REQUEST { HTTP::redirect https://[HTTP::host][HTTP::uri] } }
- Kevin_Stewart
Employee
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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com