Forum Discussion
muzammil_88686
Jul 01, 2012Nimbostratus
Redirecting to a pool
I m having a problem with an iRule.
I m trying to redirect the below "Source" URL to "Destination" URL(NOTE: Here * could be any sub URI)
Source:
=====
http://www.XYZ.com...
nitass
Jul 01, 2012Employee
and this is an example based on Eric's suggestion.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[string tolower [HTTP::uri]] starts_with "/123/"} {
HTTP::header replace Host "[string map {www hello} [HTTP::host]]:9090"
HTTP::uri [string map {/123/ /} [HTTP::uri]]
pool hello_9090_Pool
}
}
}
[root@ve10:Active] config b pool hello_9090_Pool list
pool hello_9090_Pool {
members 200.200.200.101:websm {}
}
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80 or port 9090
New TCP connection 1: 172.28.19.251(35477) <-> 172.28.19.79(80)
1341155212.1407 (0.0011) C>S
---------------------------------------------------------------
HEAD /123/something HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: www.XYZ.com
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(35477) <-> 200.200.200.101(9090)
1341155212.1428 (0.0018) C>S
---------------------------------------------------------------
HEAD /something HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: hello.XYZ.com:9090
Accept: */*
---------------------------------------------------------------
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