Forum Discussion
Change HTTP host to selected pool member IP address
Try it in the SERVER_CONNECTED event. It won't work on the first request until an LB decision has been made.
when SERVER_CONNECTED {
HTTP::header replace Host [LB::server addr]
}
Updated Just noticed you are trying to use HTTP_REQUEST_SEND, that should work. Are you using route domains? If so you will have to parse out the %rd. The getfield command will take the first field from the host header with "%" being the delimiter. If using route domains IP variables will be returned as x.x.x.x%rd. The below will work for ANY route domain by stripping off the %rd. You will be left with x.x.x.x. Get field has a start index of 1, that's why the number 1 is used. https://devcentral.f5.com/wiki/iRules.getfield.ashx
when HTTP_REQUEST_SEND {
HTTP::header replace Host [getfield [IP::server_addr] "%" 1]
}
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