Forum Discussion
Mohamed_Saalih_
Nimbostratus
Apr 02, 2014Required help for irule on single url
Virutal server ( IP 1.1.1.1--my http class will be http://xyz.com) should forward all the request to (2.2.2.2-http://abc.com) ,( 2.2.2.3-http://def.com) and (2.2.2.4 - http://ghi.com)
and from outs...
IheartF5_45022
Nacreous
Apr 02, 2014Just one approach - I'd create 3 pools;-
pl_xyz_http members {2.2.2.2:80 2.2.2.3:80}
pl_def_http members {2.2.2.3:80 2.2.2.4:80}
pl_ghi_http members {2.2.2.4:80}
Then on your VIP apply round-robin and oneconnect profile and the following iRule;-
when HTTP_REQUEST {
set path_seg1 [lindex [split [HTTP::path] / ] 1 ]
switch $path_seg1 {
"xyz" -
"abc" -
"ghi" {
Rewrite Host header
HTTP::header replace Host "${path_seg1}.com"
Rewrite path
HTTP::path "/"
pool "pl_{$path_seg1}_http"
}
default {
Will be sent to default pool attached to virtual
}
}
}
There are obviously many ways to approach this though
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