Forum Discussion
prabhat_73172
Nimbostratus
Jan 17, 2011irule to read host from HTTP request and redirect
Hello,
I have BigIP LTM 10.0.1 system that sits in front of a http proxy gateway in the call path of incoming http requests in a ISP environment.
When customer access certain websites via proxy they experience errors. I'm trying to create an irule where it reads the host field on the http header and if it contains certain words (hotmail in this example), then it will direct the traffic via pool p1 (internet router) if not then via pool p2 (proxy gateway).
When I try to implement the irule I various errors. Below is the script.
Any assistance would be greatly appreciated.
when HTTP_REQUEST {
Specify current url
set host[HTTP::host]
Specify pools
set p1 "proxy_pool"
set p2 "internet_pool"
display current url and user agent in ltm log file
log "HOST = $host"
check if host has name that has issues going through proxy
switch -glob "$host" {
"*hotmail*" -
"*weather.com*" {
log "$host GOING TO Directly to $host -- 1.2"
pool $p2
} default {
log "$host GOING Through proxy-- 1.3"
pool $p1
}
}
end of switch
11 Replies
- Chris_Miller
Altostratus
Posted By prabhat on 01/19/2011 07:28 AM
Hi Chris,
Here is the outbound when going through proxy
client->LTM->proxy->LTM->firewall->internet
Here's the outbound when the irule directs the traffic directly to the internet
client->ltm->firewall->internet.
And the firewall only allows outbound access from the proxy's IP address? Any chance we can have the LTM SNAT the traffic and have the firewall allow the SNAT addresses?
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
