cancel
Showing results for 
Search instead for 
Did you mean: 

Hint to get started on Traffic Script with a 'split' pool

SOLVED
Highlighted

Hint to get started on Traffic Script with a 'split' pool

I have got the following task from the DEVs.

- original DNS / URL ( example.com ) should be AS-IS.

- example.com/new-site should be hosted by another pool.

- example.com/everything-else should be AS-IS.

More specific, the original site has IIS/ASP.Net on the backend. The new ( example.com/new-site ) is hosted on a LAMP / WordPress stack... and creating a subsite ( new-site.example.com ) is not preferred.

Any way to achieve this?

Brgds

Bjarke Emborg Kragelund

3 REPLIES

Re: Hint to get started on Traffic Script with a 'split' pool

Hi,

$path = http.getpath();

if(string.startsWithI($path,"/new-site")){

   pool.use("newsitepool");

}

else

...

...



Re: Hint to get started on Traffic Script with a 'split' pool

Hi Nicolas et al,

Thx for the above.

The plot thickens a bit - If the 'new-site' is only listening on the header 'new-site.com' I need to rewrite the traffic towards the new pool as well.

I will give it go, but if you have some code handy?

Brgds.

Bjarke

Contributor

Re: Re: Hint to get started on Traffic Script with a 'split' pool


$path = http.getpath();



if(string.startsWithI($path,"/new-site")){



  http.setheader( "Host", "new-site.com" );



  pool.use("newsitepool");



}