一台做负载均衡分发

114.55.116.177

以下三台做业务处理器

118.178.243.35

118.178.236.8

118.178.136.39

114.55.116.177负载均衡nginx配置:

    http    
     {
             upstream baobei{
                   server 118.178.236.8:8080;
                   server 118.178.243.35:8080;
                   server 118.178.136.39:8080;
              }
    }
    server {
             listen 80;
             server_name www.xihuanbaobei.com;
             location / {
                 #反向代理的地址
                 proxy_pass http://baobei/;
             }
     }

3台业务处理器nginx上配置:


    server {    
        listen 8080;
        root /home/wwwroot/xhbb;
        index index.php index.htm index.html;
        server_name 118.178.136.39;
        access_log  /home/wwwlogs/access.log;
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php?$1 last;
            }
        }
    }

Comments are closed.