Forum Discussion
Auto SSL Selection
Hi Everyone,
I need some help designing an irule, or multiple irules. We have a customer who has their main website behind their LTM. There are two virtual servers setup for this website. One for http and the other for https. We're doing SSL offload for just a couple forms. While on port 80, if a user goes to two pages on the website, they are successfully redirected to port 443 with the following irule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/giving*" {
HTTP::redirect "https://[HTTP::host]/giving"
}
"/formsdisplay.aspx?ekfrm=12884903667" {
HTTP::redirect "https://[HTTP::host]/formsdisplay.aspx?ekfrm=12884903667"
}
}
}
Works great. However, the customer wants users to be forced back to port 80 when they are done with these links because there are other portions of the website that are jacked up when SSL is forced because of external links and whatnot. We've given them the ability to rewrite these links with stream profiles and irules but they just don't want this. They insist on having the user go back to a non-ssl virtual server. How can I accomplish the reverse of the above on the SSL virtual server or can I rebuild this whole scenario in one virtual server with switching back and forth between port 80 and 443? Is the latter even possible?
This LTM is running 10.2.4.
Thanks,
Stephen
4 Replies
- What_Lies_Bene1
Cirrostratus
It's not elegant (and you'd want to test) but you could use this on the port 443 Virtual Server;when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/giving*" - "/formsdisplay.aspx?ekfrm=12884903667" { return } default { HTTP::redirect "http://[HTTP::host][HTTP::uri]" } } } - What_Lies_Bene1
Cirrostratus
You could also improve the port 80 iRule too;when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/giving*" - "/formsdisplay.aspx?ekfrm=12884903667" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } } - Stephen_Loeckle
Nimbostratus
Ahh thank you on both suggestions. Both seem to work perfectly! You rock! - What_Lies_Bene1
Cirrostratus
You're very welcome, glad it's working.
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