Forum Discussion
Tim_Vaudt_11296
Sep 05, 2012Nimbostratus
Need to change HTTP header depending on pool member selected
Based on a pool member selected we need to change the Host name in HTTP::header before the request is sent to the target server. I have tried to do this with the following iRule but there is an erro...
Kevin_Stewart
Sep 05, 2012Employee
You should use the HTTP_REQUEST_SEND event:
https://devcentral.f5.com/wiki/iRules.HTTP_REQUEST_SEND.ashx
when HTTP_REQUEST_SEND {
log local0. "Connected to [IP::server_addr]"
switch [IP::server_addr] {
"10.70.0.1" {
log local0. "Not changing the host header"
}
"10.70.0.2" {
log local0. "changing the host header"
clientside {
HTTP::header replace Host "newhost.com"
}
}
}
}
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