Forum Discussion
Wasim_Hassan_13
Nimbostratus
Nov 20, 2014Multiple Websites on Single VIP
Hi,
I have multiple websites which are currently on Microsoft TMG. I want to migrate them to F5. There are multiple URLS hosted on different servers which are running on different ports as well...
Brad_Parker
Cirrus
Nov 21, 2014I just noticed you wanted to account for www in your HTTP-HTTPS redirect so here's an update example for that irule:
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] starts_with "www."}{
set host [string range [HTTP::host] 4 end]
}
else {
set host [HTTP::host]
}
set my_loc "https://$host[HTTP::uri]"
TCP::respond "HTTP/1.1 301 Moved Permanently\r\nLocation: $my_loc\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
TCP::close
}
The irule for the pool selection on your HTTPS VIP could look something like this:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"site1.test.com" {
pool site1_pool
}
"site2.test.com" {
pool site2_pool
}
"site3.test.com" {
pool site3_pool
}
default {
pool default_pool
}
}
}
Hope this helps.
- Wasim_Hassan_13Nov 21, 2014
Nimbostratus
you mean to say I will apply two irules to HTTPS VIP, one for the pool and one for the header/www etc. One redirect which will be on the HTTP VIP. - Brad_ParkerNov 21, 2014
Cirrus
One irule, the top one, for your HTTP VIP to handle to redirects(including accounting for www adn redirecting without it) and one iRule, the second one on the HTTPS VIP for pool selection. - Fabio_Garcia_14Jul 11, 2016
Nimbostratus
Hello guys,
I was checking this issue from 2014, but I got a question... if I have a lot os sites to configure in this IRULE example? Is it a problem for BIG IP appliance? I mean concerning CPU, memory usage... etc etc.... Thanks in advance!!
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