Forum Discussion
Need Help to create an iRule for Name Based Virtual Hosting
Hosting 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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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