I have a blog system with seperate subdomain and domains and want to use nginx to load balance application servers. <br><br><br>I want to give total number of servers available for example 5 and want to redirect all requests to the same server everytime. <br>

<br>For example <br><br><a href="http://a.blog.com/" target="_blank">a.blog.com</a> will go to server 1<br><a href="http://b.bllog.com/" target="_blank">b.bllog.com</a> =&gt; server 2<br><a href="http://b.bllog.com/x.html" target="_blank">b.bllog.com/x.html</a> =&gt; server 2<br>

<a href="http://xx.com/" target="_blank">xx.com</a> =&gt; server 1<br><br>and so on. <br><br><br>I am thinking doing this by converting domain name &quot;<a href="http://a.blog.com/" target="_blank">a.blog.com</a>&quot;
to number with crc32 and modulo that number to number of servers (5)&nbsp;
and remaining number wiill deceide which server to send this requests. <br>
<br>I wander how to do this. is it through perl or can it be done with config file alone. and how to to it in any way?