Forum Discussion
knight207_63919
Nimbostratus
Sep 19, 2011Proxy 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
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects