Forum Discussion
Kai_Wilke
Dec 14, 2015MVP
Hi Ferhat,
as Stanislas already explained your LTM would already take care of the load balancing decission, based on available pool members and the configured load balancing lalgorythm. So no need to use iRules for that...
To change the HOST headers value to reflect the selected node IP and also port number you may use this rather simple iRule...
when HTTP_REQUEST_SEND {
HTTP::host "[IP::server_addr]:[TCP::server_port]"
}
... or if using multiple route domains...
when HTTP_REQUEST_SEND {
HTTP::host "[getfield [IP::server_addr] "%" 1]:[TCP::server_port]"
}
The outlined iRule will be triggered on each HTTP request right before sending the request to the real server and simply changes to HOST header value to the IP and Port of the selected server.
Cheers, Kai