verynginx +nginx_upstream_check_module模块,负载均衡检查模块。
./configure --prefix=/usr/local/verynginx --user=nginx --group=nginx --with-http_v2_module --with-http_sub_module --with-http_stub_status_module --with-luajit --with-openssl=/opt/nginx/openssl-1.0.2l --add-module=/opt/nginx/openresty-1.9.15.1/bundle/nginx-1.9.15/nginx_upstream_check_module/
make -j 4
make install
user nginx;worker_processes auto;- #daemon off; #如果要在docker运行,加这个参数让nginx在前台运行
error_log logs/error.log;error_log logs/error.log notice;error_log logs/error.log info;pid logs/nginx.pid;events {worker_connections 1024;}include /usr/local/verynginx/verynginx/nginx_conf/in_external.conf;http {include mime.types;default_type application/octet-stream;log_format access '$host $remote_addr - - $time_local "$request" "$http_referer" "$http_user_agent" $body_bytes_sent "$http_x_forwarded_for" $request_length $status $request_time';sendfile on;keepalive_timeout 65;client_body_buffer_size 128k;gzip on;include /usr/local/verynginx/verynginx/nginx_conf/in_http_block.conf;# include /usr/local/verynginx/nginx/conf/vhosts/*.conf;server {listen 80;include /usr/local/verynginx/verynginx/nginx_conf/in_server_block.conf;location = / {root html;index index.html index.htm;}}include /usr/local/verynginx/nginx/conf/vhosts/*.conf;}
mkdir -p /usr/local/verynginx/nginx/conf/vhosts/
vim t.conf
upstream nsignature {
server 127.0.0.1:9998 weight=1;
server 127.0.0.1:9998 weight=1;
check interval=3000 rise=2 fall=5 timeout=1000;
check_http_send "GET /1 HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
server {
listen 80;
server_name test.xxx.cn;
location /{
proxy_pass http://nsignature;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /nstatus {
check_status;
access_log off;
allow all;
}
access_log /var/log/test.log access;
}
upstream vn_upstream{
server 127.0.0.1;
balancer_by_lua_file /usr/local/verynginx/verynginx/lua_script/on_banlance.lua;
keepalive 1024; #Connection pool
}
lua_package_path '/usr/local/verynginx/verynginx/lua_script/?.lua;;/usr/local/verynginx/verynginx/lua_script/module/?.lua;;';
lua_package_cpath '/usr/local/verynginx/verynginx/lua_script/?.so;;';
lua_code_cache on;
lua_shared_dict status 1m;
lua_shared_dict frequency_limit 10m;
lua_shared_dict summary_long 10m;
lua_shared_dict summary_short 10m;
init_by_lua_file /usr/local/verynginx/verynginx/lua_script/on_init.lua;
rewrite_by_lua_file /usr/local/verynginx/verynginx/lua_script/on_rewrite.lua;
access_by_lua_file /usr/local/verynginx/verynginx/lua_script/on_access.lua;
log_by_lua_file /usr/local/verynginx/verynginx/lua_script/on_log.lua;
verynginx +nginx_upstream_check_module模块,负载均衡检查模块。的更多相关文章
- [转帖]nginx upstream模块--负载均衡
nginx upstream模块--负载均衡 https://www.cnblogs.com/linjiqin/p/5494783.html Module ngx_http_upstream_modu ...
- nginx upstream模块--负载均衡
Module ngx_http_upstream_module英文文档 upstream模块相关说明1.upstream模块应放于nginx.conf配置的http{}标签内2.upstream模块默 ...
- 基于LNMP(fastcgi协议)环境部署、原理介绍以及fastcgi_cache配置以及upstream模块负载均衡讲解
ngx_http_proxy_module只能反向代理后端使用HTTP协议的主机.而ngx_http_fastcgi_module只能反向代理后端使用FPM或者使用FastCGI协议的客户端. 一.部 ...
- nginx负载均衡fair模块安装和配置
nginx-upstream-fair-master fair模块源码 官方github下载地址:https://github.com/gnosek/nginx-upstream-fair说明:如果从 ...
- 【Web】Nginx 反向代理与负载均衡
反向代理 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客 ...
- Nginx负载均衡设置max_fails和fail_timeout
在Nginx的负载均衡检查模块中,对于负载均衡的节点可以配置如下可选参数: max_fails=1 fail_timeout=10s 这个是Nginx在负载均衡功能中,用于判断后端节点状态,所用到两个 ...
- Nginx负载均衡策略
目前nginx负载均衡支持的5种方式的分配 1. 轮询 每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除. upstream backserver { server ...
- Nginx安装负载均衡配置 fair check扩展
前言 本文主要是针对Nginx安装.负载均衡配置,以及fair智能选举.check后端节点检查扩展功能如何扩展,进行讲解说明. fair模块: upstream-fair,“公平的”Nginx 负载均 ...
- linux负载均衡总结性说明(四层负载/七层负载)
在常规运维工作中,经常会运用到负载均衡服务.负载均衡分为四层负载和七层负载,那么这两者之间有什么不同?废话不多说,详解如下: 一,什么是负载均衡1)负载均衡(Load Balance)建立在现有网络结 ...
随机推荐
- [bzoj4602][Sdoi2016]齿轮——dfs
题目 现有一个传动系统,包含了N个组合齿轮和M个链条.每一个链条连接了两个组合齿轮u和v,并提供了一个传动比x : y.即如果只考虑这两个组合齿轮,编号为u的齿轮转动x圈,编号为v的齿轮会转动y圈.传 ...
- laravel 获得各个根文件夹路径的方法及路由的一些使用
各个根文件夹路径的方法 APP目录: app_path(); config目录: config_path(); public目录: public_path(); storage目录: storage_ ...
- python3 正则表达式re模块
正则表达式的功能:字符串的模糊匹配查询import re元字符 . ---->匹配除换行符意外的任意字符 ^ ---->匹配行首位置 $ ---->匹配行尾位置 关于重复的元字符 * ...
- PHP性能追踪及分析工具xhprof的安装与使用
对于本地开发环境来说,进行性能分析xdebug是够用了,但如果是线上环境的话,xdebug消耗较大,配置也不够灵活,因此线上环境建议使用xhprof进行PHP性能追踪及分析. 我们今天就简单介绍一下x ...
- python通过POST提交页面请求
http://blog.csdn.net/liyzh_inspur/article/details/6294292 #网页POST提交数据 import urllibimport urllib2url ...
- HDU1284 钱币兑换问题
钱币兑换问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Subm ...
- virtualbox网络相关
前言 Baidu/google了n多次, 效果不佳. 网上说的都是比较老的virtualbox版本,有的是默认就bridge方式(2.2.0前), 有的不是bridge方式的,是通过工具uml-uti ...
- postman发送post请求,报405 Method Not Allowed
postman发送post请求,报405 Method Not Allowed: 亲测有效的方案一: 检查请求header是否缺少必要信息.如果不清可以把所有的头部信息全部粘贴到header中,尝试是 ...
- H5智能表单
表单 keygen元素的作用是提供一种验证用户的可靠方法 datalist 元素规定输入域的选项列表 output元素用于不同类型的输出,比如计算或脚本输出 智能表单 input 新增type值 em ...
- css用法(持续更新ing)
*:选择所有节点 #container:选取id为container的节点 .container:选取所有class包含container的节点 li a:选取li下的所有a节点 ul +p:选取ul ...