Forum Discussion
Sylvain_85827
Cirrus
Jul 02, 2013Rewrite URL based on selected node for load-balancing
Dears iRules Gurus and community,
Once again I need your help ^^ I'm wondering how to rewrite an URL of HTTP requests (IPP in fact) depending on the node chosen for load-balancing the traffic. ...
Sylvain_85827
Cirrus
Jul 03, 2013Thanks Kevin for your help and your tips. I really appreciate.
In fact I don't really need to know the number of the node, I can directly use the IP address.
Basically I want to rewrite the Host header depending on the node selected for load-balancing the traffic.
What do you think of this iRule:
when HTTP_REQUEST_SEND {
Need to force the host header replacement and HTTP:: commands into the clientside context
as the HTTP_REQUEST_SEND event is in the serverside context
clientside {
switch -glob [LB::server addr] {
"1.1.1.1" {
HTTP::header replace Host "newHostHeader01"
}
"1.1.1.2" {
HTTP::header replace Host "newHostHeader02"
}
etc...
}
}
}
Do you think a more proper way to do that?
Thanks in advance for your valuable feedback.
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