Forum Discussion
Chris_Admas_391
Nimbostratus
Jun 29, 2006Simple http redirect according to port
I'm sure you've already answered this if so sorry.
How would I write an irule for the following situation.
I have http traffic http://www.domain.com to vs 1 (http) and two physical...
dennypayne
Employee
Jun 30, 2006Chris,
If the requests for www.domain.com are always port 80 and requests for secure.domain.com are always going to come in 443 then you should not need a rule if you set it up as hoolio described. The port definition on each VIP will process the traffic to the correct pool (understand that 10.1.1.2:80 and 10.1.1.2:443 are separate VIP's even though they have the same IP and so they may be assigned to separate pools).
If you are concerned that requests for secure.domain.com are going to come in port 80, then you may address that with an iRule to perform a redirect.
You would apply the rule to the port 80 VIP, something like this (syntax not validated):
when HTTP_REQUEST {
if { [HTTP::host] equals "secure.domain.com" } {
HTTP::redirect https://secure.domain.com
} else {
pool pool_1
}
}actually if pool_1 is the default you don't even really need the else statement, if the "if" doesn't fire, the rule will just fall out to the default pool on the port 80 VIP.
Hope that helps,
Denny
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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