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]
}
Stanislas_Piro2
Nov 19, 2015Cumulonimbus
why did you try to change irule provided by Brad... his irule may work, your irule not.