Forum Discussion
meena_60183
Nimbostratus
Nov 10, 2008redirect after SSL termination
Hi All,
I have a scenario where the webserver only responds if there is a particular URI, say WebEdition. I also have SSL termination configured for this VS. The web server only listens on port 80.
I have the following 4 scenarios
1. http://www.example.com -> redirect to -> https://www.example.com/WebEdition
2. https://www.example.com -> redirect to -> https://www.example.com/WebEdition
3. http://www.example.com/WebEdition redirect to https://www.example.com/WebEdition
4. https://www.example.com/WebEdition (no need for redirection and just decrypt the traffic and send clear text to the server).
I created couple of iRules but nothing seems to work and I always get "page cannot be displayed".
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
HTTP::redirect "https://www.example.com/WebEdition"
}
}
and I applied this to the http traffic.
I also tried
when HTTP_REQUEST {
if {[HTTP::host] equals "www.example.com" } {
HTTP::redirect https://www.example.com/WebEdition
}
}
Both are created after looking at some samples on this forum.
I am not sure how to apply the iRule to the https traffic since it will be encrypted. How can I ensure that it is applied after the decryption?
thanks,
Meena
7 Replies
Sort By
- James_Quinby_46Historic F5 AccountAre you terminating SSL on your LTM or on the application server itself?
- meena_60183
Nimbostratus
SSL termination is done on the BigIP. - Colin_Walker_12Historic F5 AccountThe iRule will automatically be applied after the decryption. The events you're using (HTTP events) are processed after the BIG-IP has already decrypted the traffic.
when HTTP_REQUEST { if { [HTTP::host] eq "www.example.com" } { if { (!([HTTP::uri] starts_with "/WebEdition")) or ([TCP::local_port] != 443) } { HTTP::redirect "https://www.example.com/WebEdition" } } }
- meena_60183
Nimbostratus
But this will not redirect https://www.example.com to https://www.example.com/WebEdition. Will it? - dennypayne
Employee
It will...the ! will make it redirect any URI that does not start with /WebEdition. - meena_60183
Nimbostratus
I did not see the ! on the first condition and also just noticed that it was "or" for the conditions and not "and". - dennypayne
Employee
I'm thinking you don't need the TCP::local_port check, since you are decrypting, that is probably evaluating to 80 which would make this loop since it always matches !=443).
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects