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 ...
随机推荐
- 超越LLMNR /NBNS欺骗 - 利用Active Directory集成的DNS
利用名称解析协议中的缺陷进行内网渗透是执行中间人(MITM)攻击的常用技术.有两个特别容易受到攻击的名称解析协议分别是链路本地多播名称解析(LLMNR)和NetBIOS名称服务(NBNS).攻击者可以 ...
- 设计模式 (二)——观察者模式(Observer,行为型)
1.概述 使用设计模式可以提高代码的可复用性.可扩充性和可维护性.观察者模式(Observer Pattern)属于行为型模式,在对象之间定义一对多的依赖,这样一来,当一个对象改变状态,依赖它的对象都 ...
- CentOS/Linux下设置IP地址
CentOS/Linux下设置IP地址 1:临时修改:1.1:修改IP地址# ifconfig eth0 192.168.100.100 1.2:修改网关地址# route add default g ...
- EOJ2018.10 月赛(A 数学+思维题)
传送门:Problem A https://www.cnblogs.com/violet-acmer/p/9739115.html 题意: 能否通过横着排或竖着排将 1x p 的小姐姐填满 n x m ...
- 窗体焦点监听事件WindowFocusListener
public class Demo extends JFrame { JLabel label;//定义变量,以便在自定义方法类中调用 public Demo() { setBounds(100, ...
- 五个免费UML建模工具
UML工具很多是商用的,价格不菲:而免费的UML建模工具,功能完善的很少.以下推荐的是五个免费的UML建模工具,相对而言还算功能比较不错. 免费UML建模工具推荐:JUDE – community 如 ...
- 转:scrollWidth,clientWidth,offsetWidth的区别
scrollWidth:对象的实际内容的宽度,不包边线宽度,会随对象中内容超过可视区后而变大. clientWidth:对象内容的可视区的宽度,不包滚动条等边线,会随对象显示大小的变化而改变. off ...
- js对象之window和document区别
window是整个页面的全局环境,而document可以理解为整个页面这个最大的元素(整个dom树) window: 可以看到window下面有很多变量 document: 可见document是整个 ...
- idea集成python插件
idea集成python插件 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在继承安装Python插件时,请确认你是否安装Python解释器(Python官网:https://ww ...
- Linux shell 自启动脚本写法
直接上脚本内容 #!/bin/bash #chkconfig: 2345 80 90 #description:sniffer #第一行,告诉系统使用的shell,所以的shell脚本都是这样. #第 ...