Forum Discussion
Shridhar_84609
Nimbostratus
Aug 24, 2009Redirecting the URI
Hello,
I have a requirement to do the following -
http://abc.com/timesheets
should fetch the data from -
http://server1.com:30945/GroupServer/en/
...
hoolio
Cirrostratus
Aug 26, 2009Hi Shridhar,
What do the logs show when you make a request to abc.com/ and abc.com/timesheets?
You are close on your summary. But there are a few points:
If I typed http://abc.com/timesheets, the Big-IP would first select the pool 'timesheets_http_pool' & try to look into http://server2:40702/timesheets, which is NOT present on the server. Coming to the next condition, since even the second 'if' statement also holds good, the HTTP::path would be changed to "/GroupServer/en" and thats it, the Big-IP is NOT going to again look into the pool for http://server2:40702/GroupServer/en.
LTM is only checking the request details from the client--not checking anything in the server response or what may or may not exist on the server(s). So for a request to abc.com/timesheets, the timesheet_http_pool would be used. If the requested path was exactly /timesheets, the path will be rewritten to /GroupServer/en. Do you need to rewrite the path for other requests which start with /timesheets but aren't exactly "/timesheets"? If so, do you need to preserve part of the requested path in the rewritten path? Maybe /timesheets/anything gets rewritten to /GroupServer/en? If so, you can replace this in the iRule:
if {[HTTP::path] eq "/timesheets"}{
Rewrite path
HTTP::path "/GroupServer/en"
log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to /GroupServer/en"
}
with this:
Rewrite path mapping /timesheets to /GroupServer/en
HTTP::path [string map {/timesheets /GroupServer/en} [HTTP::path]]
log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to [string map {/timesheets /GroupServer/en} [HTTP::path]]"
Suppose I typed http://abc.com/Shridhar, the Big-IP would firstly choose the default_http_pool and will try to look for http://server1:30945/Shridhar.
The next 'if' statement would get executed only if I have typed http://abc.com/.
Exactly correct.
OK....I type http://abc.com/ in the browser now.
The Big-IP selects the default_http_pool and tries to look into http://server1:30945/ and will not find any data (because the data exists in http://server1:30945/primaveraweb).
The next 'if' statement will also get executed because I only typed http://abc.com/ this time. But the action now taken is to only change the HTTP path from '/' to '/primaveraweb' and thats it. The Big-IP again is NOT gonna select the default_http_pool and look into http://server1:30945/primaveraweb as that part is already executed.
Both the pool selection and the path rewrite are done, so a request for http://abc.com/ will get sent to the default pool and because the requested path was / it will be rewritten to /primavera.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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