Forum Discussion
irule redirect by url.
I will be implementing the irule below, will it do what im needing, it did pass irule editor. what im needing to do is rediect to different pools based on the url header. We will have different public dns names assigned to the same public IP and then natted to the VIP. The iRule will redirect the to pool based on the url header. Our goal is to save IP's for some very small sites that are needed.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { a-mysite.zcorp.com { pool a-mysite-pool } b-mysite.zcorp.com { pool b-mysite-pool }
c-mysite.zcorp.com { pool c-mysite-pool } b-mysite.zcorp.com { pool d-mysite-pool }
e-mysite.zcorp.com { pool e-mysite-pool }
default { reject } } }
1 Reply
- Kevin_Stewart
Employee
You're technically correct, but I would put the switch conditions inside double quotes.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "a-mysite.zcorp.com" { pool a-mysite-pool } "b-mysite.zcorp.com" { pool b-mysite-pool } "c-mysite.zcorp.com" { pool c-mysite-pool } "b-mysite.zcorp.com" { pool d-mysite-pool } "e-mysite.zcorp.com" { pool e-mysite-pool } default { reject } } }
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