nginx 负载配置

一、下载pcre

官网下载:http://www.pcre.org/
# wget http://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz/download


二、安装zlib

# ./configure --prefix=/usr/local/zlib

# make && make install


三、安装openssl

# wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz

# cd openssl-1.0.1h.tar.gz

# tar -xzvf openssl-1.0.1h.tar.gz


四、安装nginx

tar zxvf nginx-1.7.3.tar.gz

 ./configure --prefix=/usr/local/nginx  --with-pcre=../pcre-8.35 --with-http_stub_status_module --with-http_ssl_module --with-zlib=../zlib-1.2.8  --with-openssl=../openssl-1.0.1h


make

make  install

检查是否安装成功

cd  /usr/local/nginx/sbin
 ./nginx -t


重启

/usr/local/nginx/sbin/nginx -s  reload



nginx.conf

upstream miu-member-server {      
      server  172.17.190.32:4020;
      server  172.17.190.33:4020;
    }
    
    upstream miu-mobile-server {
      server  172.17.190.32:4010;
      server  172.17.190.33:4010;
    }
    
    upstream miu-wechat-server {
      server  172.17.190.34:4030;
      server  172.17.190.35:4030;
    }
    
    upstream image {
      server  172.17.190.34:4040;
      server  172.17.190.35:4040;
    }


location /miu-mobile-server/ {
            proxy_pass  http://miu-mobile-server/;
            proxy_redirect default;
        }
        
        location /miu-member-server/ {
            proxy_pass  http://miu-member-server/;
            proxy_redirect default;
        }
        
        location /miu-wechat-server/ {
            proxy_pass  http://miu-wechat-server/;
            proxy_redirect default;
        }
        
        location /image/ {
            proxy_pass  http://image/;
            proxy_redirect default;
        }
        
        location ~ /(favicon.ico|robots.txt) {
            log_not_found off;
        }



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值