Forum Discussion
Matt_H_58911
Nimbostratus
Sep 17, 2007BIG-IP 9.1.0 Build 6.2 IRULE ** Newbie**
I've inherited this wonderful device and now need to learn how to write an irule.
Objective:
What I would like to do is match on a URL and send requests for certain portions of pages to a new server(via IP address).
For example, any request coming in for
http://www.domainname.com/cached/* or
http://www.domainname.com/assets/* or
http://www.domainname.com/art/*
is then sent to a specific destination server.
Any assistance would be very helpful
Thanks!
- Matt_H_58911
Nimbostratus
My first attempt at this: - dennypayne
Employee
That should work fine. If your list grows beyond 3 URLS, you will probably want to look at the matchclass functions (see the wiki) so that you can do one comparison against a list instead of a comparison for each possibility. - dennypayne
Employee
EDIT: See this post Click here for more information about default pool selection...it is usually better to explicitly define it. - Matt_H_58911
Nimbostratus
Denny, - Matt_H_58911
Nimbostratus
Further clarification on the above is that the code will drop you to the new server (NFS) or the NFS pool but then we need to be able to traverse back to the default web pool. How do I add at the end of the code that the following request after it gets what is needed from the NFS pool to go back to the web pool? - Deb_Allen_18Historic F5 AccountHi Matt -
You'll also need to apply a OneConnect profile to ensure that multiple requests on the same connections are not routed to the first pool chosen for that connection.when HTTP_REQUEST { switch -glob [HTTP::uri] { *cached - *assets - *art {pool NSF} default {pool web} } }
- Matt_H_58911
Nimbostratus
Deb, - Matt_H_58911
Nimbostratus
I've looked at implementing the OneConnect profile and it appears to be out of my league. Looking at the ONECONNECT::detach [enable | disable ] - Matt_H_58911
Nimbostratus
Will the above code work? I'm trying to test this and it appears to still be using the NFS pool. - Deb_Allen_18Historic F5 AccountOh, sorry for the confusion. I should have been clearer.
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