Load Balance by domain name

Riverbed logo

Wrote this little bit of TrafficScript for some clients today and published to the Joyent wiki. I think it’s pretty readable.


$hostHeader = http.getHostHeader();
if( $hostHeader == "domain.com" || $hostHeader == "www.domain.com"){
pool.select( "domain.com-pool" );
}
else if( $hostHeader == "another-domain.com" ){
pool.select( "another-domain.com-pool" );

Enjoy

Posted in Foundations, Technology | Tagged as: , , | Leave a comment

Leave a Reply