Forum Discussion
iRule for specific URL to be sent to singel node in the pool
Hello, We are looking to direct traffic based on a specific URL to a single node in our pool.
Does anyone know the best way to accomplish this task?
Thank you, Claude Chouinard
2 Replies
- Claude_Chouinar
Nimbostratus
This is what I have come up with. when HTTP_REQUEST { if { [string tolower [HTTP::uri] equals http://www.companyname.com/images/alp/captchaImages] } { pool 'pool_name' member 10.10.10.65 80 } } This is the error I receive using the iRule Editor Exception caught in LocalLB::urn:iControl:LocalLB/Rule::create() Exception: Common::OperationFailed primary_error_code : 17236305 (0x01070151) Any help would be appreciated. Thanks secondary_error_code : 0 error_string : 01070151:3: Rule [/Common/iRuler_Parse_Test_Rule] error: /Common/iRuler_Parse_Test_Rule:2: error: [invalid index: should be integer or "end"][equals] /Common/iRuler_Parse_Test_Rule:2: error: [invalid index: should be integer or "end"][http://www.alphabroder.com/images/alp/captchaImages] - Kevin_Stewart
Employee
A few syntactical errors:
-
Your [string tolower ] command should only be encapsulating the HTTP::uri, not the entire string.
[string tolower [HTTP::uri]] -
Your URL should probably be in double quotes.
-
The [HTTP::uri] command is only going to retrieve the URI portion of the URL, so it would see
/images/alp/captchaImages -
You don't need to encapsulate the pool name in single quotes.
So assuming you don't really care about the Host portion of the URI, something like this should work for you:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals "/images/alp/captchaImages" } { pool pool_name member 10.10.10.65 80 } } -
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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