Forum Discussion
Eric_Frankenfie
Feb 20, 2014Nimbostratus
Rewrite Portion of URI
We are moving one of our web services to a new pool of servers which will contain a different virtual directory structure. The legacy servers used a separate virtual directory for each customer, but...
nitass
Feb 23, 2014Employee
e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 14
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:80 {
address 200.200.200.101
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/CUST_A/" } {
HTTP::uri [string map {/CUST_A/ /app.web/APPvirtualDirectory/} [HTTP::uri]]
}
HTTP::header replace Host "www.mysite-new.com"
}
}
test
[root@ve11a:Active:In Sync] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.24.1(39115) <-> 172.28.24.10(80)
1393145648.5634 (0.0029) C>S
---------------------------------------------------------------
HEAD /CUST_A/Login.aspx?C=98620001&UN=COMS8365&PW=av99er89uj&F=EN 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
Accept: */*
Host: www.mysite-old.com
---------------------------------------------------------------
New TCP connection 2: 200.200.200.14(39115) <-> 200.200.200.101(80)
1393145648.5958 (0.0298) C>S
---------------------------------------------------------------
HEAD /app.web/APPvirtualDirectory/Login.aspx?C=98620001&UN=COMS8365&PW=av99er89uj&F=EN 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
Accept: */*
Host: www.mysite-new.com
---------------------------------------------------------------
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