Load Balancing PHP

Mickie D nginx-forum at nginx.us
Mon May 31 21:08:32 MSD 2010


Hi there I am trying to load balance my website between 2 servers.

I have set them both up to mirror each other

But they are a forum and using PHP ???

This is the code I have but it will only use one site.

It only uses the 127.0.0.1 local address and will not contact my other PHP server ?

I opened the port 9000 on both machines via iptables ???

 [code]
upstream newsite {
  server 127.0.0.1:9000;
  server 15.82.114.196:9000;
  }

     server
     {
             listen       80;
             server_name  thissite.com;
             index index.html index.htm index.php;
             root  /data0/htdocs/www/forum;



             location ~ .*\.php?$
             {
                  include fcgi.conf;
                  fastcgi_pass  newsite;
                fastcgi_index index.php;


             }
[/code]

Thank you very much

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92738#msg-92738




More information about the nginx mailing list