Forum Discussion
AngryCat_52750
Feb 28, 2013Nimbostratus
Changing Hostnames and URIs
we are making a service call to an external vendor. We call - internal.apple.com/foo/bar/pear.svc and we make it vendor.example.com/foo/bar/pear.svc with a irule -
when HTTP_REQUEST {
HTTP::header replace Host "vendor.example.com"
}
Is there a way to make internal.apple.com/fruits to become vendor.example.com/foo/bar/pear.svc ???
- What_Lies_Bene1CirrostratusThere is, something like this will do exactly what you want (but won't modify other URIs, they must match exactly);
when HTTP_REQUEST { HTTP::header replace Host "vendor.example.com" if { [string tolower [HTTP::uri]] equals "/fruits" } { [HTTP::uri] "/foo/bar/pear.svc" } }
- nitassEmployeei think the last HTTP::uri should not have brackets around.
when HTTP_REQUEST { HTTP::header replace Host "vendor.example.com" if { [string tolower [HTTP::uri]] equals "/fruits" } { HTTP::uri "/foo/bar/pear.svc" } }
- What_Lies_Bene1CirrostratusThanks Nitass, you are correct. =]
- AngryCat_52750NimbostratusGuys. instead of an if for the URI portion, could i do this instead?
switch -glob [string tolower [HTTP::uri]] { "/fruits" { HTTP::uri "/foo/bar/pear.svc" } }
- Michael_YatesNimbostratusHi kulastone,
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