Forum Discussion
kona2-9_51980
May 17, 2012Nimbostratus
Trying to create an iRule to serve multiple http and https pools based off of a single VIP
I am attempting to create a single vip looking for port * that when requests are recieved it will look at the uri and decide which pool to direct the traffic to.
I have four pools :
tes...
Michael_Yates
Jun 04, 2012Nimbostratus
Hi kona2-9,
I agree with Joel’s suggestion of splitting your HTTP and HTTPS Traffic onto separate Virtual Servers (on for 80 and one for 443).
On your HTTP Virtual Server you do not need any SSL Profiles. On your HTTPS Virtual Server you will need an SSL Profile (Client) at a minimum. If you have an SSL Certificate installed on the Web Server then you will also need to enable the SSL Profile (Server) as well to re-encrypt the traffic between the LTM and the Web Server.
If you follow the suggestion of using two Virtual Servers and you want to maintain the logic in a single iRule that could be applied to both the HTTP and HTTPS Virtual Server you could do something like this, or separate the logic into two simpler iRules (one for HTTP and one for HTTPS).
when HTTP_REQUEST {
switch [TCP::server_port] {
"80" {
switch -glob [string tolower [HTTP::host]] {
"*testa.org" { pool testa.org }
"*testb.org" { pool testb.org }
}
}
"443" {
switch -glob [string tolower [HTTP::host]] {
"*testa.org" { pool testa.org-ssl }
"*testb.org" { pool testb.org-ssl }
}
}
}
}
Hope this helps.
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