knight207_63919
Sep 19, 2011Nimbostratus
Proxy outbound HTTP base on User Agent
I am somewhat new to iRules so this is my first go.
I want to send outbound HTTP requests from certain browers to proxy servers using the user agent. Anything not matching should just forward out to default gateway.
Any comments or suggestions appreciated.
when HTTP_REQUEST {
if { [HTTP::header "User-Agent"] contains "MSIE" } {
Match user agent MSIE and sent to Pool with persist profile
persist PER-HTTP-PROFILE-A
pool PROXY-POOL-HTTP
}
else if { [HTTP::header "User-Agent"] contains "Firefox" }{
Match user agent Firefox and sent to Pool with persist profile
persist PER-HTTP-PROFILE-B
pool PROXY-POOL-HTTP
}
else if { [HTTP::header "User-Agent"] contains "Chrome" }{
Match user agent Chrome and sent to Pool with persist profile
persist PER-HTTP-PROFILE-B
pool PROXY-POOL-HTTP
}
else {
do nothing and send connection to default gateway using IP_Forwarding_virtual_server
forward
}