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 ...
随机推荐
- oh-my-zsh的安装与基本配置
1. 准备工作 安装需要用到:wget curl git zsh 官网:http://ohmyz.sh/ GitHub主页:https://github.com/robbyrussell/oh-my- ...
- [IOI2018] seats 排座位
[IOI2018] seats 排座位 IOI2018题解 压缩状态思想很不错的 每次把原来的贡献减掉,新来的再加上 最多涉及10个点 注意: 1.去重 2.下标从0开始 3.线段树初始的最小值个数都 ...
- P1339 热浪 最短路径模板题
这么naive的题面一看就是最短路模板题~~~ ok.首先是floyd算法,tts,记得把k放在最外面就行了. #include <cstdio> #include <cstring ...
- 警告: No data sources are configured to run this SQL and provide advanced code assistance. Disable this inspection via problem menu (Alt+Enter). more... (Ctrl+F1) SQL dialect is not configured. Postgr
python3出现问题: 警告: No data sources are configured to run this SQL and provide advanced code assistance ...
- 用c语言实现http请求
用c语言来实现一个简单的http请求,请求 www.cnblogs.com 首页 #include<stdio.h> #include<stdlib.h> #include&l ...
- Ansible playbook 批量修改服务器密码 先普通后root用户
fsckzy Ansible playbook 批量修改服务器密码 客户的需求:修改所有服务器密码,密码规则为Rfv5%+主机名后3位 背景:服务器有CentOS6.7,SuSE9.10.11,r ...
- 收到offer!
今天收到了自己中意的offer,公司在上海,这也意味着自己毕业后的第一份工作也要结束了. 要说再见了,杭州,尽管相处的时间不久,也认识了一些朋友.还得向他们做声道别. 心情滋味难名,短短的一年,自己由 ...
- 运用Zabbix实现内网服务器状态及局域网状况监控(4) —— Zabbix客户端安装
1. 创建用户 [root@zabbix ~]# groupadd zabbix [root@zabbix ~]# useradd -g zabbix zabbix 2. 安装zabbix_3.2 ...
- Dubbo协议
参考dubbo官方文档http://dubbo.apache.org/zh-cn/docs/user/references/protocol/dubbo.html dubbo共支持如下几种通信协议: ...
- fffmgg
翻译: 一.GOALS 你应该学习: 基本概念 安装ffmpeg和工具 编码视频 应用过滤器 分析视频 二.要求 这些幻灯片ffmpeg,ffprobe和ffplay的安装一些示例视频,例如:Big ...