I’m shooting for a slightly different config: nginx behaves solely as a load balancer. apache2 is serving all static and dynamic content. (it’s running wordpress mu, in fact).
I’m not sure what my nginx.conf looks like in total.
So far, this is what I have - it’s not yet working as I’d hoped (i.e. passing all http requests through to one or more of the apache2 servers). Any direction and assistance you can provide is greatly appreciated.
# this is where you define your mongrel clusters.
# you need one of these blocks for each cluster
# and each one needs its own name to refer to it later.
upstream stag-ts {
ip_hash;
server 209.20.86.108:80; # ts-www0
server 209.20.86.117:80; # ts-www1
server 209.20.87.81:80; # ts-www2
}
server 209.20.86.108:80; # ts-www0
server 209.20.86.117:80; # ts-www1
server 209.20.87.81:80; # ts-www2
I would have private messaged, but did not see that option. With hope, all can learn.
Many thanks, best regards, and please let me know what *stupid* thing I’m doing.
S
About Me
I’m Sameer Parwani a 25 year old web developer from Massachusetts. I aim to use this blog to contribute to the tech community with my own thoughts, tips, and insights. I am occasionally available for contract work. Check the about page for more.
Load Balancing with Nginx
March 31st, 2009 at 8:12 pmThanks for the article, Sameer.
I’ve read this and your nginx setup article.
I’m shooting for a slightly different config: nginx behaves solely as a load balancer. apache2 is serving all static and dynamic content. (it’s running wordpress mu, in fact).
I’m not sure what my nginx.conf looks like in total.
So far, this is what I have - it’s not yet working as I’d hoped (i.e. passing all http requests through to one or more of the apache2 servers). Any direction and assistance you can provide is greatly appreciated.
my actual public ips are in the server entries.
Many thanks, and please let me know if there’s other info I can provide to assist in troubleshooting
Load Balancing with Nginx
March 31st, 2009 at 8:51 pmMany thanks, Sameer -
Load Balancing with Nginx
March 31st, 2009 at 10:04 pmHello -
A few differences - and the source of my confusion - are on the following directives:
I’ve got apache on port 80, so I presume nginx out to be listening on another port. True statement?
I don’t plan to serve any content directly via nginx. I’ve commented this section out.
so, here’s where I presumed to add my ip_hash of servers:
My update:
Am I on the correct path?
Again, I appreciate your time and assistance a great deal.
Load Balancing with Nginx
April 1st, 2009 at 2:52 amThank you, again, Sameer -
nginx and apache are on different physical hosts. Both listening on port 80.
nginx is still fulfilling requests I presumed it would be passing along.
I’m seeing nothing in the logs or from the clients (workstation web browser) to say anything’s going beyond nginx’ default config:
http://209.20.83.83/
I’m sure I’m missing something simple.
My goal is to pass all requests to one of the apache2 nodes. Apache logfiles show nothing.
Requesting the IP or domain name via browser client passes nothing to www0 - www2.
I’m fronting a different physical boxes (x3) for apache. Those refer to a different physical box for mysql.
The goal is for requests to http://209.20.83.83/ to be distributed to
server 209.20.86.108:80; # ts-www0
server 209.20.86.117:80; # ts-www1
server 209.20.87.81:80; # ts-www2
I would have private messaged, but did not see that option. With hope, all can learn.
Many thanks, best regards, and please let me know what *stupid* thing I’m doing.
S