Forum Discussion
Shridhar_84609
Nimbostratus
Aug 25, 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/
http://abc.com/
should fetch the data from -
http://server2.com:40702/primaveraweb
where server1 & server2 are internal servers & abc.com is the virtual server to be configured on the Big-IP.
Please advise.
Regards,
Shridhar
- hoolio
Cirrostratus
Hi Shridhar,when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: "New [HTTP::method] request to [HTTP::host][HTTP::uri]" Check if requested path starts with /timesheets if {[HTTP::path] starts_with "/timesheets"}{ log local0. "[IP::client_addr]:[TCP::client_port]: Matched /timesheets check" pool timesheets_http_pool Rewrite path if path is exactly /timesheets if {[HTTP::path eq "/timesheets"}{ Rewrite path HTTP::path "/GroupServer/en" log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to /GroupServer/en" } } else { Use default HTTP pool pool default_http_pool log local0. "[IP::client_addr]:[TCP::client_port]: Using default_http_pool" Rewrite path if path is exactly /timesheets if {[HTTP::path eq "/"}{ Rewrite path HTTP::path "/primaveraweb" log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to /primaveraweb" } } }
- Shridhar_84609
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
Hi Shridhar,Use default HTTP pool pool default_http_pool log local0. "[IP::client_addr]:[TCP::client_port]: Using default_http_pool" Rewrite path if path is exactly /timesheets if {[HTTP::path eq "/"}{ Rewrite path HTTP::path "/primaveraweb" log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to /primaveraweb" }
- hoolio
Cirrostratus
Hi Shridhar,if {[HTTP::path] eq "/timesheets"}{ Rewrite path HTTP::path "/GroupServer/en" log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to /GroupServer/en" }
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]]"
- Shridhar_84609
Nimbostratus
Thanks for making me understand the iRule execution process, Aaron. The issue got resolved. I had to make a change in your iRule to get it working. - hoolio
Cirrostratus
Ah, so you want requests for /timesheets or /GroupServer to go to the /timesheets pool. Nice work in tracing this and updating the iRule.
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