Forum: NGINX nginx to load balance application servers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
zimbirti zimbirti (Guest)
on 2009-02-03 14:17
(Received via mailing list)
I have a blog system with seperate subdomain and domains and want to use
nginx to load balance application servers.


I want to give total number of servers available for example 5 and want
to
redirect all requests to the same server everytime.

For example

a.blog.com will go to server 1
b.bllog.com => server 2
b.bllog.com/x.html => server 2
xx.com => server 1

and so on.


I am thinking doing this by converting domain name "a.blog.com" to
number
with crc32 and modulo that number to number of servers (5)  and
remaining
number wiill deceide which server to send this requests.

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?
dennis cao (Guest)
on 2009-02-04 05:59
(Received via mailing list)
i think it may use the url_hash
it is not bnuilt-in
you can down the patch from the nginx's website



Date: Tue, 3 Feb 2009 12:04:00 +0000Subject: nginx to load balance
application serversFrom: removed_email_address@domain.invalid: 
removed_email_address@domain.invalid
have a blog system with seperate subdomain and domains and want to use
nginx to load balance application servers. I want to give total number
of servers available for example 5 and want to redirect all requests to
the same server everytime. For example a.blog.com will go to server
1b.bllog.com => server 2b.bllog.com/x.html => server 2xx.com => server
1and so on. I am thinking doing this by converting domain name
"a.blog.com" to number with crc32 and modulo that number to number of
servers (5)  and remaining number wiill deceide which server to send
this requests. 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?
This topic is locked and can not be replied to.