vADC Forum

Reply
New Contributor
Posts: 2
Registered: ‎12-14-2012
Accepted Solution

Redirecting based on URL: Rule selected an unresolvable host warning messages.

Our goal is to redirect based on the URL.  So basically, https://test.com/test1 would go to the server test1, while https://test.com/test2 would go to the server test2.

We are getting Rule selected an unresolvable host warning messages in line 19. We are also seeing issues downloading all the resources from a page.   When we look at the http traffic using web debuggers, we are seeing long delays and blocking periods for elements like images to download.   Some are taking 30-60 seconds.  When we test directly from the webserver (http://localhost/test1) we cannot reproduce the problem.  

Here is a copy of the rule we have:


$host = http.getHeader( "Host");


if (http.headerExists( "X-Forwarded-For") || $host == "" ) {


   http.sendResponse( "400 Bad request", "text/plain", "This is a proxy service, you must send proxy requests", "");


}



$pos = string.find( $host, ":");


if($pos >= 0) {


   $port = string.skip( $host,$pos + 1);


   $host = string.substring( $host,0,$pos - 1);


} else {


   $port = 80;


}


http.setHeader( "X-Forwarded-For", request.getRemoteIP() );


http.removeHeader( "Range" );


http.removeHeader( "Proxy-Connection" );



$rawurl = http.getRawURL();


if( string.contains( $rawurl, "/ema" ) ) {


   pool.use( "test1", $rawurl , $port );


}





New Contributor
Posts: 10
Registered: ‎11-30-2012

Re: Redirecting based on URL: Rule selected an unresolvable host warning messages.

Hello RWW725,

If I understand correctly your requirement is that you want to select a specific node in a pool for a given URL match. If I assume test1 and test2 are the nodes in the pool named "testpool" then you need to change the arguments  to the function pool.use as

          pool.use ("testpool","test1",$port);

Since you have provided $rawurl as the argument as node name, this might be the reason why you might be seeing a warning message.

-vinay

New Contributor
Posts: 2
Registered: ‎12-14-2012

Re: Redirecting based on URL: Rule selected an unresolvable host warning messages.

This worked and the page loads instantly.  Thanks so much!

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.