nginx安装

1、yum install gcc gcc-c++

2、tar -jxvf jemalloc-5.2.1.tar.bz2

3、cd jemalloc-5.2.1

4、./configure --prefix=/usr/local/jemalloc

make

make install

5、yum install openssl openssl-devel -y

6、./configure --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --prefix=/usr/local/nginx --with-jemalloc=/usr/local/jemalloc-5.2.1 --with-stream --add-module=./modules/ngx_http_upstream_check_module/  --without-http_rewrite_module

7、

make

make install

8、

vim /usr/local/nginx/conf/nginx.conf

添加下方配置

  upstream mspp {

        server 192.168.10.253:8080;

        server 192.168.10.252:8080;

        server 192.168.10.133:8080;

        check interval=3000 rise=2 fall=5 timeout=1000 type=http;

        check_http_send "HEAD / HTTP/1.0\r\n\r\n";

        check_http_expect_alive http_2xx http_3xx;

    }

    server {

        listen       80;

        server_name  localhost

         location / {

            proxy_pass http://mspp;

        }

          location /status {

            check_status;

            access_log   off;

            #allow SOME.IP.ADD.RESS;

            #deny all;

        }

error_page   500 503 504  /50x.html;

location = /50x.html {

            root   html;

        }

        error_page 502 /502;

        location = /502 {

            default_type application/json;

                add_header Content-Type 'text/html; charset=utf-8';

                return 200 '{"code":"6666,"msg":"服务正在维护中,请稍后再试!"}';

        }

 }

启动服务

sbin/nginx -c conf/nginx.conf

转载于:https://www.cnblogs.com/bzdmz/p/11526028.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值