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

  • 相关阅读:
    Python subprocess- call、check_call、check_output
    Java Annotation认知(包括框架图、详细介绍、示例说明) (转)
    NVME SSD vs SATA SSD(转)
    scala中“_”的用法
    maven scope 'provided' 和 ‘compile’的区别
    scala tuple中的syntactic sugar
    Scala中的"null" 和“_”来初始化对象
    scala可变长度参数(转)
    Java中的Builder模式
    Scala中“=>”用法及含义
  • 原文地址:https://www.cnblogs.com/bzdmz/p/11526028.html
Copyright © 2011-2022 走看看