Forum Discussion
girishb
Cirrus
Jan 25, 2020Need Help to create an iRule for Name Based Virtual Hosting
We are trying to build iRule for one newly build tomcat server when the F5 picks one of the new pool members, the iRule needs to route the request, in a round robin manner, to the different instances...
Samir
MVP
Jan 26, 2020Hosting multiple websites on the same virtual server and load balancing requests to the appropriate webserver based on the host name requested. This can be achieved via iRule or F5 policy also.
** Make sure IP address bind with multiple DNS CNAME.
* Create the LB Pool based on the application requirement.
Pool_A[ 1perf.cloud123.com, 3perf.cloud123.com]
Pool_B [ 2perf.cloud123.com, 4perf.cloud123.com]
* Create iRule
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
switch -glob $host {
"www.xyz.com" {
pool pool_A
}
"www.pqr.com" {
pool pool_B
}
default { reject }
}
}
* Create the Virtual Server and assign irule.
Hope it will solve issue.
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