Forum Discussion
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 forwar...
Michael_Yates
Sep 19, 2011Nimbostratus
I would suggest using a Switch Statement rather than nested If Statements for efficiency and inside of your default behavior put a logging statement that you can enable periodically to see what other types of browsers are hitting your Virtual Server (or if you want to identify one to add it to your switch statement). When not in use you can disable it.
when HTTP_REQUEST {
switch -glob [HTTP::header User-Agent] {
"*MSIE*" { do something }
"*Firefox*" { do something }
"*Chrome*" { do something }
default {
log local0. "Unhandled User Agent: [HTTP::header User-Agent]"
}
}
}
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