tengine离线安装及健康检查模块

tengine离线安装及健康检查模块

1、下载地址

http://tengine.taobao.org/download_cn.html

2、解压缩安装
tar -zxvf tengine-1.4.0.tar.gz
cd tengine-1.4.0
./configure --prefix=/usr/local/tengine --with-http_upstream_check_module
make && make install
3、配置端口、添加健康检查、启动nginx
# 切换到安装目录,修改配置文件
cd /usr/local/tengine/conf
vim nginx.conf
#nginx.conf 文件添加健康检查
upstream test {
        server 10.84.162.57:8088;

        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 http_4xx;
}

server {
        listen       80;
        server_name  test;
        client_max_body_size 500M;
        #在"Content-Type"应答头中加入指定的charset
	    charset utf-8;
	    
        location / {
            #域名转发
            proxy_set_header HOST $host:$server_port;
	        proxy_pass http://test;
        }
}
# 启动nginx
../sbin/nginx
posted on 2021-03-05 17:21  cxbks  阅读(61)  评论(0)    收藏  举报