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 ...
随机推荐
- can总线的示波器检测方法
stm32的can总线是在APB1上的,stm32f10x的主频是72Mhz,can外设时钟是36Mhz,stm32f2xx的主频是120Mhz,can外设时钟是30Mhz... STM32 APB1 ...
- P1186 玛丽卡 删边最短路最大值
反正蛮水的一道题. 胡雨菲一句话让我的代码减少了10行还A了,之前的是个错的. 思路:先求出最短路,然后依次删去最短路上的每一条边,跑最短路求最大值. 关于删边:我的想法是当作链表删除,把last的n ...
- Qt shortcuts
ESC 切换到代码编辑模式 F1 查看帮助 F4 .h 与 .c or .cpp之间切换 shift + F2 声明与定义间切换 Ctrl + tab 切换已打开的文件 Ctrl + B 编 ...
- mysql -- 索引补充
.unique索引补充:联合唯一 unique(name,email)是name和email这两列联合起来唯一,不再试某个字段唯一 .主键索引,类似唯一索引,也是允许联合多个字段作为主键,例如:pri ...
- iframe伪造ajax
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 学习windows编程 day5 之 区域裁剪
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRU ...
- win2003服务器安全设置教程
服务器安全设置 1.系统盘和站点放置盘必须设置为NTFS格式,方便设置权限. 2.系统盘和站点放置盘除administrators 和system的用户权限全部去除. 3.启用windows自带防火墙 ...
- Socket 连接建立过程
阻塞模式下: 1,客户端向服务器端发起请求建立连接时,服务器端只需要运行到 serverSocket = ); 客户端注册的 SelectionKey.OP_CONNECT 事件就能够发生. 也就是 ...
- TCP/IP详解 卷1 第十八章 TCP的建立与终止
第十八章 TCP的建立与终止 tcpdump Tcpdump可以将网络中传送的数据报完截获下来进行分析.它支持针对网络层.协议.主机.网络或端口的过滤,并提供and.or.not等逻辑语句来帮助你去掉 ...
- 六道JavaScript测验题
1.找出数字数组中最大的元素(使用Match.max函数) var a=[123,23432,345,3,34]; console.log(Math.max.apply(null,a)); 2.转化一 ...