Forum Discussion
webguy9_97931
Nimbostratus
May 22, 2007iRule proxy
Hello,
I am looking to proxy requests based on:
1) UserAgent (bot detection)
2) URL patterns (foo\.html)
How do I set up the iRule to handle this?
Thanks!
Kevin_Holicky_5
Nimbostratus
Jun 04, 2007Hi Joe... I have been working with webguy9. What needs to happen is everytime a bot or a particular URI pattern occurs in any HTTP_REQUEST, we need to proxy that request to a completely different domain (hosted at a 3rd party site)
Here is what we have right now:
when HTTP_REQUEST {
if { [matchclass [HTTP::host] equals $::SomeHost] } {
if { not ([matchclass [string tolower [HTTP::header User-Agent]] contains $::Bots] or [matchclass [string tolower [HTTP::uri]] contains $::SomeURI]) } {
pool SomePool
}
else
{
HTTP::redirect "http://3rdpartysite.com[HTTP::uri]"
}
}
}
So basically what needs to be different is the HTTP::redirect... would replacing it with this line be suffucient?
HTTP::header replace "Host" "http://3rdpartysite.com[HTTP::uri]"
Thanks
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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