Forum Discussion
assaf_benedic_1
Nimbostratus
Aug 31, 2006redirecting HTTP traffic based on the HTTP method type (GET, POST, etc.)
Hi ,
How can I redirect traffic based on HTTP method type?
I tried the following iRule:
when HTTP_REQUEST
lf { [HTTP::method] contains "GET" }{
log "forwarding [HTTP::method] method to the web"
meaning - not redirecting GET requests to my HTTP servers.
}
else {
log "redirecting [HTTP::method] method to HTTP servers"
}
}
When HTTP GET requests were received, I noticed that the "if" was true but the BigIP redirected the traffic to the HTTP servers and not forwarded the packets directly to the internet.
As far as I know "forward" sends the packets according to the routing table.
Did I do something wrong?
Thanks in advance,
Assaf.
- Deb_Allen_18Historic F5 AccountYour rule needs to specify in the "if" and "else" clauses how you'd like the traffic to be managed. What you have there is simply logging the indicated messages and sending all requests to the default pool defined for the virtual.
where "forwarding_pool" and "server_pool" are pools defined with the intended destinations.when HTTP_REQUEST { if { [HTTP::method] contains "GET" }{ log "forwarding [HTTP::method] method to the web" pool forwarding_pool } else { log "redirecting [HTTP::method] method to HTTP servers" pool server_pool } }
- assaf_benedic_1
Nimbostratus
Hi, - unRuleY_95363Historic F5 AccountWhat you probably want is more like this:
Where proxy_pool contains your proxy servers.when HTTP_REQUEST { if { [HTTP::method] eq "GET" }{ log "forwarding [HTTP::method] method to the web" forward } else { log "redirecting [HTTP::method] method to HTTP servers" pool proxy_pool } }
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