Forum Discussion
Brad_Parker_139
Nacreous
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]
}
Mate_132781
Nov 19, 2015Cirrostratus
Hi,
great hint. Yes, we are using Route Domains and partitions.
Route domain 10 id default route domain for partition uder which nodes, pools VS and iRules are created.
I tred syntax you sent, but still it's not working.
when HTTP_REQUEST_SEND {
HTTP::header replace Host [getfield [IP::server_addr] "%"10]
}