You are missing the server block within the http section. If you look above you need both upstream and server. Upstream defines a set of hosts that requests will be passed to. But you still need the server block to define which requests are passed to which upstream. What I’ve written in the original post, I believe, is exactly what you are looking for.
Okay first both apache and nginx default to listen on port 80. Since you are using nginx as your frontend you want the experience to be seamless for users, so you keep nginx on 80 and you set apache to listen to another port. This assumes that nginx and apache are running on the same server and listening on the same ip. If not you don’t have to mess with port settings. So, anyway, setting nginx as port 80 allows people to visit your site via http://www.mysite.com instead of http://www.mysite.com:8080/
Yes it makes sense to comment out that block of code. As for the rest, I’m not quite sure if your syntax is valid. But heres how I would do it…
So lets say you have nginx running on 000.20.86.000 on port 80 and you have apache running on port 8080 on 000.20.86.000, 000.20.87.000, and 000.20.88.000. This is how your nginx configuration file should look.
upstream mysite {
server 000.20.86.000:8080; # ts-www0
server 000.20.87.000:8080; # ts-www1
server 000.20.88.000:8080; # ts-www2
}
server {
listen 80;
server_name http://www.mysite.com;
location / {
proxy_pass http://mysite;
}
}
And this is how apache should look (also remember to change it to listen on port 8080 instead of 80): I’m using brackets instead of arrows since wordpress seems to be choking on the arrows.
Ben, I tested it for you and both increment/decrement and multi-get work.
And, true about the google suggestion. It is something I plan to write more about in the future.
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:30 pmYou are missing the server block within the http section. If you look above you need both upstream and server. Upstream defines a set of hosts that requests will be passed to. But you still need the server block to define which requests are passed to which upstream. What I’ve written in the original post, I believe, is exactly what you are looking for.
Load Balancing with Nginx
March 31st, 2009 at 10:37 pmOkay first both apache and nginx default to listen on port 80. Since you are using nginx as your frontend you want the experience to be seamless for users, so you keep nginx on 80 and you set apache to listen to another port. This assumes that nginx and apache are running on the same server and listening on the same ip. If not you don’t have to mess with port settings. So, anyway, setting nginx as port 80 allows people to visit your site via http://www.mysite.com instead of http://www.mysite.com:8080/
Yes it makes sense to comment out that block of code. As for the rest, I’m not quite sure if your syntax is valid. But heres how I would do it…
So lets say you have nginx running on 000.20.86.000 on port 80 and you have apache running on port 8080 on 000.20.86.000, 000.20.87.000, and 000.20.88.000. This is how your nginx configuration file should look.
upstream mysite { server 000.20.86.000:8080; # ts-www0 server 000.20.87.000:8080; # ts-www1 server 000.20.88.000:8080; # ts-www2 } server { listen 80; server_name http://www.mysite.com; location / { proxy_pass http://mysite; } }And this is how apache should look (also remember to change it to listen on port 8080 instead of 80): I’m using brackets instead of arrows since wordpress seems to be choking on the arrows.
NameVirtualHost 000.20.86.000:8080 {VirtualHost 000.20.86.000:8080} DocumentRoot /path/to/site ServerName http://www.mysite.com {/VirtualHost}Elgg Scalability
April 8th, 2009 at 4:45 amSorry, I have not looked into the new release yet. Once I do, I will come up with a followup post
Facebook Scribe Server Documentation And Tutorials
May 14th, 2009 at 3:05 pmYou could take a look at rsyslog.
Tokyo Tyrant with PHP
May 17th, 2009 at 1:30 amAccording to the documentation, Tokyo Tyrant supports atomic increment so it should work.
Tokyo Tyrant with PHP
May 17th, 2009 at 4:44 pmBen, I tested it for you and both increment/decrement and multi-get work.
And, true about the google suggestion. It is something I plan to write more about in the future.