Forum Discussion
Sriram_87174
Nimbostratus
May 16, 2013iRule - newbie question
Hi F5 Guru's,
I am a newbie and this is my first post. My experience with iRules is very junior level. Would appreciate some expert advise on the following scenario.
1 VIP -----prov...
Kevin_Stewart
Employee
May 17, 20131a. If you're going to use HTTP-based iRules you must have an HTTP profile applied.
1b. Considering that you're directing traffic to specific HTTP (port 80) and HTTPS (port 443) pools, then yes you should enable port translation, but it probably wouldn't hurt either way.
2a. The important aspect of this configuration is that you're doing HTTP and HTTPS on the same VIP. It would be easier to use separate port 80 and port 443 VIPs with the same IP address. In a single VIP config, however, you need to be able to turn the client and server SSL profiles on or off based on the client request. Something like this should work:
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 80 } {
SSL::disable clientside
SSL::disable serverside
URI pool selection logic
if { [string tolower [HTTP::uri] starts_with "/foo" } {
pool Http_Pool_A
} elseif { [string tolower [HTTP::uri]] starts_with "/bar" } {
pool Http_Pool_B
}
} elseif { [TCP::local_port] == 443 } {
URI pool selection logic
if { [string tolower [HTTP::uri]] starts_with "/sslfoo" } {
pool Https_Pool_A
} elseif { [string tolower [HTTP::uri]] starts_with "/sslbar" } {
pool Https_Pool_B
}
} else {
drop everything else
discard
}
}
With this iRule applied, you'll also want to set a client and server SSL profile on the VIP by default. When it encounters a port 80 request it'll turn them both off.
2b. I think the above iRule covers that.
2c. I think the above (single) iRule covers that too.
3. Create your 4 pools and assign them their own individual monitors. The BIG-IP will handle the rest naturally.
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