zoukankan      html  css  js  c++  java
  • 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 ";

            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

  • 相关阅读:
    【组合数学】AGC036C
    【数位贪心】loj#530. 「LibreOJ β Round #5」最小倍数
    【概率dp】vijos 3747 随机图
    【线段树 经典技巧】10.7序列绝对值
    【杂题】10.7爬树
    【组合数学 思维题】10.6种树
    【换根dp】9.22小偷
    【高维前缀和】8.15B. 组合数
    【技巧 dp】1566: [NOI2009]管道取珠
    【经典dp 技巧】8.13序列
  • 原文地址:https://www.cnblogs.com/bzdmz/p/11526028.html
Copyright © 2011-2022 走看看