dyobbs_25515
Feb 15, 2012Nimbostratus
iRule rewrite then forward request to pool
hi,
Requirement:
iRule that basically truncates and rewrites the URL, then forward request to pool. Then pool will accept request, then will process it and send back ack to user.
user ------> F5 [rewrite URL] [forward request] ---> pool (pool_cache)
Issue:
However, when using httpwatch, i found out that after rewriting the URL, it doesn't forward it to my cache pools.
Browser now goes directly to the URL site, bypassing my cache/proxy.
www.google.com.removeme.com ----> www.google.com
rule myrules {
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set newhost [string map {".removeme.com" ""} $host]
if {$host ne $newhost} {
HTTP::redirect "http://$newhost[HTTP::uri]"
}
Will this iRule direct it to my pool after rewriting, then cache will reply back to user?
rule myrules {
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set newhost [string map {".removeme.com" ""} $host]
if {$host ne $newhost} {
pool pool_cache}
any inputs is appreciated.
tnx,