cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Specific URL Path Requests to Different Pool

SOLVED
gr_stanley
Occasional Contributor

Sending Specific URL Path Requests to Different Pool

We're trying to do the following, but it doesn't seem to be working.

We have a Virtual Server "VS" with Default Traffic Pool "DEFAULT-POOL".

"DEFAULT-POOL" consists of three nodes:

10.0.0.1:80

10.0.0.2:80

10.0.0.3:80

"VS" has a rule "RULE" defined as:

Condition: If URL Path starts with "/EXCEPTION/"

Action: Choose Pool "EXCEPTION-POOL"

"EXCEPTION-POOL" consists of one node:

10.0.0.1:80

I would think that any requests being sent to VS that starts with "/EXCEPTION/" would be sent to the "EXCEPTION-POOL", but this doesn't seem to be working.

I am still seeing requests starting with "/EXCEPTION/" on 10.0.0.2:80 and 10.0.0.3:80

Is something configured incorrectly, or am I misunderstanding how it is supposed to work?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
gr_stanley
Occasional Contributor

Re: Sending Specific URL Path Requests to Different Pool

We've managed to get this sorted out. The rule was properly defined, just not case sensitive.

View solution in original post

3 REPLIES 3
michael.g.zuckerman
Occasional Contributor

Re: Sending Specific URL Path Requests to Different Pool

Stanley,

Add the following rule to the virtual server as a request rule.

Mike

# Get the URL from the HTTP get request

$path = http.getpath();

      if( string.startsWithI( $path, "/EXCEPTION/" ) )

{

   pool.use( "EXCEPTION-POOL" );

}

else

{

   pool.use( "DEFAULT-POOL" );

}

gr_stanley
Occasional Contributor

Re: Sending Specific URL Path Requests to Different Pool

We've managed to get this sorted out. The rule was properly defined, just not case sensitive.

mohantytp
Not applicable

Re: Sending Specific URL Path Requests to Different Pool

Hi Stanley,

I don't understand what do you mean by "The rule was properly defined, just not case sensitive".

I have taken care of the exact case. My script is shown as below. But it doesn't work.

==================

$path = http.getpath();

if( string.contains( $path, "my.example.com" ) ){

        pool.use( "NON DEFAULT POOL" );

}

==================

It also fails with the following (Case insensitive)

==================

$path = http.getpath();

if( string.containsI( $path, "my.example.com" ) ){

        pool.use( "NON DEFAULT POOL" );

}

==================

I think the condition validation above is not working. If I remove the condition as below then it works with non default pool.

=================

pool.use( "NON DEFAULT POOL" );

==================

Please let me know.

Thanks & Regards - Tarini