iRule for HTTP redirect, destination address persistence based on HTTP::URI
Hi All,
I have been using an iRule to elect a pool member from a pool which is closest to the client based on the client ip address. Then an HTTP redirect would be send to that client to connect to the actual server. This works well but now we are in the need of another type of iRule where we can optimize our caches. But since the web directories and files are dynamic (adaptive bitrate streaming (HLS)) we cannot use the folders or paths in the iRule code...
Lets say I have two caching reverse proxies (node1 and node2) and three clients (client1, client2 and client3) and two HLS encoded movies (movie1 and movie2).
If client1 requests movie1 "http://{BigIp_f5_ltm_VIP}/vod/movie1/movie1.m3u8" I would like to have an HTTP redirect send by the load balancer back to the client to go to "http://{node1_ip}/vod/movie1/movie1.m3u8".
Then if client 2 requests the same url "http://{BigIp_f5_ltm_VIP}/vod/movie1/movie1.m3u8" an HTTP redirect message would need to be send back to the client to connect to node1 again (because client1 was send there before).
Now if client3 comes by for movie2 "http://{BigIp_f5_ltm_VIP}/vod/movie2/movie2.m3u8" an HTTP redirect to go to node2 would need to be send back to the client.
Basically this would mean that I need HTTP redirection with destination ip address persistence based on the HTTP::URI. How can I do this?
Thanks in advance,
Jeroen