Forum Discussion
Chadwick_McInni
Nimbostratus
Jul 16, 2008BIG-IP as proxy
I'd like the BIG-IP to determine if an HTTP GET should go to our web proxy or not. I'd like the BIG-IP to examine [HTTP::host] in an HTTP_REQUEST, and if [HTTP::host] does NOT contain "mydomain" then use a pool that contains our webproxy. We proxy requests for external hosts, I'd like the BIG-IP to keep requests to internal hosts internal, and send requests to external hosts to our web proxy.
Below is what I have so far. This is working for requests to google and yahoo, but not for requests to "mydomain". If I go this route I'll have to list every external host name (google, yahoo, etc). That list might get a little big!
iRule bigproxy
when HTTP_REQUEST {
log "http host is [HTTP::host]"
if { [HTTP::host] contains "google" or
[HTTP::host] contains "yahoo" } {
pool bigproxy
}
}
Ideas? Suggestions?
Thanks!
Chad
- hoolio
Cirrostratus
Hi Chad,when HTTP_REQUEST { log "http host is [HTTP::host]" if { not ([string tolower [HTTP::host]] contains "mydomain")} { pool bigproxy } }
- Chadwick_McInni
Nimbostratus
Thanks Aaron! That works great. - Chadwick_McInni
Nimbostratus
Thanks again Aaron, i have now specified an "else" pool, and that fixed that problem. Here's how the rule looks now: - Chadwick_McInni
Nimbostratus
I've found a working solution with this iRule: - hoolio
Cirrostratus
You'll only be able to use the virtual command to specify a new VIP for the connection on 9.4+. The example you have listed above would output the current virtual server name--and cause a syntax error. Are you able to upgrade?
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