006_nginx动态upstream和安全检查模块
一、参考Tengine http://tengine.taobao.org/document_cn/http_dyups_cn.html
ngx_http_dyups_module
Description
This module can be used to update your upstream-list without reloadding Nginx.
TODO:
It can not work with common `nginx_upstream_check_module`.
Compilation
The module is not compiled into Tengine by default. It can be enabled with '--with-http_dyups_module'
configuration parameter, and enabled lua support with '--with-http_dyups_lua_api'.
But it can not be compiled as a '.so'.
在http块中引用如下的配置=>
http {
dyups_upstream_conf upstream/ngconf_dyups.conf;
include upstream/ngconf_dyups.conf; #假如已经include进来的话就不需要include了;eg: include upstream/*.conf;
} cat upstream/ngconf_dyups.conf server {
listen 8866;
location / {
dyups_interface; #you should add the directive dyups_interface into your config file to active this feature
}
}
xxx-svr-backend
server 10.103.101.169:8080
server 10.103.104.207:8080 xxx-admin-backend
server 10.103.105.81:9001
server 10.103.105.80:9001 xxx-admin.alta.jyall.me.alta1-hg-xxx-admin
server 10.103.105.81:9001
server 10.103.105.80:9001 xxx.alta.jyall.me.alta1-hg-xxx-proxy
server 10.103.101.169:8080
server 10.103.104.207:8080
<2>curl -H "host: dyhost" 127.0.0.1:8866/list #获取upstream的名称列表
xxx-svr-backend
xxx-admin-backend
xxx-admin.alta.jyall.me.alta1-hg-xxx-admin
xxx.alta.jyall.me.alta1-hg-xxx-proxy
<3>curl -H "host: dyhost" 127.0.0.1:8866/upstream/xxx-svr-backend #根据upstream的名字找出它后端的server列表
server 10.103.101.169:8080
server 10.103.104.207:8080
<4>添加或更新一个upstream
curl -d "server 127.0.0.1:8089;server 127.0.0.1:8088;" 127.0.0.1:8866/upstream/arun_test
curl -d "server 127.0.0.1:9000;server 127.0.0.1:8088;" 127.0.0.1:8866/upstream/arun_test
curl -H "host: dyhost" 127.0.0.1:8866/upstream/arun_test
server 127.0.0.1:9000
server 127.0.0.1:8088
<5>curl 127.0.0.1:8866/detail
arun_test
server 127.0.0.1:9000
server 127.0.0.1:8088
<6>curl -i -X DELETE 127.0.0.1:8866/upstream/arun_test #动态删除upstream
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2017 12:05:58 GMT
Content-Length: 7
Connection: keep-alive success
curl 127.0.0.1:8866/detail再次查看"arun_test"的upstream已经被删除了。
-------------------------------------------------------------------------ngx_http_upstream_check_module--------------------------------------------------------------------------------
四、upstream检查模块。
http://tengine.taobao.org/document_cn/http_upstream_check_cn.html
006_nginx动态upstream和安全检查模块的更多相关文章
- Windows应急响应和系统加固(2)——Windows应急响应的命令使用和安全检查分析
Windows应急响应的命令使用和安全检查分析 1.获取IP地址: ·ipconfig /all,获取Windows主机IP地址信息: ·ipconfig /release,释放网络IP位置: ·ip ...
- 7、nginx的upstream及fastcgi模块应用
ngx_http_proxy_module, ngx_http_upstream_module ngx_http_proxy_module:实现反向代理及缓存功能 proxy_pass http: ...
- DSO动态加载PHP模块到Apache服务器
PHP在Linux/Unix平台上经常与Apache搭配使用,在安装PHP时,有三种安装方式可供选择:静态模式.动态模式(DSO).CGI二进制模式. 由于易于维护和升级,我强烈建议以DSO方式安装P ...
- 动态编译添加php模块
注意:转载请注明出处:http://www.programfish.com/blog/?p=85 在很多时候我们用linux里搭建web服务器的时候会需要编译安装php套件,而在编译安装后可能又会需要 ...
- saltstack主机管理项目:动态调用插件解析-模块解析(五)
一.动态调用插件解析 1.目录结构 1.base_module代码解析: def syntax_parser(self,section_name,mod_name,mod_data): print(& ...
- Angular中懒加载一个模块并动态创建显示该模块下声明的组件
angular中支持可以通过路由来懒加载某些页面模块已达到减少首屏尺寸, 提高首屏加载速度的目的. 但是这种通过路由的方式有时候是无法满足需求的. 比如, 点击一个按钮后显示一行工具栏, 这个工具栏组 ...
- 021_nginx动态upstream检查
GET: 请求指定的页面信息,并返回实体主体.HEAD: 只请求页面的首部. #参考:http://tengine.taobao.org/document_cn/http_upstream_check ...
- Nginx的配置与部署研究,Upstream负载均衡模块
Nginx 的 HttpUpstreamModule 提供对后端(backend)服务器的简单负载均衡.一个最简单的 upstream 写法如下: upstream backend { server ...
- 高性能Web服务器Nginx的配置与部署研究(15)Upstream负载均衡模块
Nginx 的 HttpUpstreamModule 提供对后端(backend)服务器的简单负载均衡.一个最简单的 upstream 写法如下: server backend1.example.co ...
随机推荐
- Linux 系统缓存机制学习
前言:本文为参考他人的文章,是一篇学习记录型博客.理解linux的系统缓存机制有助于理解elasticsearch实时更新的原理. 一.缓存机制 为了提高文件系统性能,内核利用一部分物理内存分配出缓冲 ...
- c++ io标准库2
转自:http://www.2cto.com/kf/201110/109445.html 接下来我们来学习一下串流类的基础知识,什么叫串流类? 简单的理解就是能够控制字符串类型对象进行输入输出的类,C ...
- A1019. General Palindromic Number
A number that will be the same when it is written forwards or backwards is known as a Palindromic Nu ...
- 文件拷贝, 使用 BIO,NIO的对比,四种写法性能分析。
测试环境: jdk 1.7 + 2G内存 测试代码基本上复制了: http://blog.csdn.net/tabactivity/article/details/9317143 1 2 3 4 5 ...
- vcf文件(call variants得来的)怎么看变异是纯合还是杂合的
如下图片所示: 对于位置为48245131的allele来说,REF为A,ALT为C 想确定变异到底是纯合还是杂合,即两条染色体是否同时发生了变异,则看GT,GT对应的数值为0/1,说明该变异为杂合: ...
- 弹窗中修改select默认值遇到的问题
弹窗中修改select默认值无效 前提: 项目中遇到一个需求, 在一个弹窗中,有很多个select都是在打开弹窗的同时由js自动生成的(每次打开都自动重新生成一遍). 弹窗打开后,从每个select的 ...
- 多个 ng-app 中 Controllers & Services 之间的通信
原文发布在个人独立博客上,链接:http://pengisgood.github.io/2016/01/31/communication-between-multiple-angular-apps/ ...
- 百度echart初用总结
1.先下载echarts.js.我在百度下载的是 echarts-2.2.7 (from Baidu).压缩包里面的build->dist中的echarts.js或者echarts-all.js ...
- Apache Solr 初级教程(介绍、安装部署、Java接口、中文分词)
Python爬虫视频教程零基础小白到scrapy爬虫高手-轻松入门 https://item.taobao.com/item.htm?spm=a1z38n.10677092.0.0.482434a6E ...
- jenkins在windows平台自动化构建代码
jenkins服务端:centos6.8 客户端:windows server2012 windows10 工具:cwRsync 注:复制为jenkins工作目录到网站目录,无需服务端. 1.安装je ...