参考:

https://github.com/vozlt/nginx-module-vts#installation

https://github.com/kubernetes/ingress-nginx

nginx-module-vts第三方nginx status模块

安装第三方模块

nginx-module-vts

mkdir /usr/local/nginx/3rdmodules
cd /usr/local/nginx/3rdmodules
git clone git://github.com/vozlt/nginx-module-vts.git ./configure --user=nginx --group=nginx --prefix=/usr/local/tengine-2.1.2 --with-http_stub_status_module --with-http_ssl_module --add-module=/usr/local/nginx/3rdmodules/nginx-module-vts
make && make install
server {
listen 80;
server_name 192.168.x.x;
auth_basic "secret";
auth_basic_user_file /usr/local/nginx/conf/.pass; location /ngx_status {
stub_status on;
allow 127.0.0.1;
allow 192.168.8.0/24;
allow 192.168.9.0/24;
deny all;
}
location /ngx_statuss {
stub_status on;
vhost_traffic_status_display;
vhost_traffic_status_display_format html;
allow 127.0.0.1;
allow 192.168.8.0/24;
allow 192.168.9.0/24;
deny all;
}
}

nginx测试

直接vim即可,不要用cat加nginx.conf

user  nginx;
worker_processes 1; error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid; events {
worker_connections 1024;
} http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf; server {
server_name 192.168.x.x;
location /ngx_status {
stub_status on;
}
}
}

nginx status要出来,必须得有server_name

访问时候只有server_name和端口匹配时候才能访问到,不然会报权限问题(被规则拒绝)

stub_status模块默认allow all.

docker run -it --rm --net=host -v /root/nginx.conf:/etc/nginx/nginx.conf:ro -v /etc/localtime:/etc/localtime:ro nginx

mkdir -p /data/nginx-html
echo "maotai" > /data/nginx-html/index.html docker run -d \
--net=host \
--restart=always \
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
-v /etc/localtime:/etc/localtime:ro \
-v /data/nginx-html:/usr/share/nginx/html \
--name nginx \
nginx

[svc]nginx-module-vts第三方模块安装配置的更多相关文章

  1. 循序渐进nginx(三):日志管理、http限流、https配置,http_rewrite模块,第三方模块安装,结语

    目录 日志管理 access_log error_log 日志文件切割 自定义错误页 http访问限流 限制请求数 语法 使用 限制连接数 语法 测试 补充: https配置 使用 生成证书 配置ng ...

  2. nginx第三方模块安装方法

    nginx第三方模块安装方法 ./configure --prefix=/你的安装目录 --add-module=/第三方模块目录 比如echo模块. 没安装前,使用测试. location /tes ...

  3. python基础-7模块,第三方模块安装方法,使用方法。sys.path os sys time datetime hashlib pickle json requests xml

    模块,用一砣代码实现了某个功能的代码集合. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代码的重用性和代码间的耦合.而对于一个复杂的功能来,可能需要多个函数才 ...

  4. Python的第三方模块安装

    python的第三方模块安装一般使用python自带的工具pip来安装. 1.在Windows下,在安装python时勾选[安装pip]和[添加python至环境变量]. 如果在python安装目录的 ...

  5. Python入门之第三方模块安装

    Python入门之第三方模块安装 平台:Win10 x64 + Anaconda3-5.3.0 (+Python3.7.0) Issue说明:pip install line_profiler-2.1 ...

  6. nginx负载均衡fair模块安装和配置

    nginx-upstream-fair-master fair模块源码 官方github下载地址:https://github.com/gnosek/nginx-upstream-fair说明:如果从 ...

  7. 玩玩 Nginx 2-----给Nginx添加第三方模块(动态更新upstream)

          接上一篇,我们在初始化安装的时候添加了nginx_lua模块,然后了解到nginx不可以动态加载模块,所以当你安装第三方模块的时候需要覆盖nginx文件.接下来一起看看如何安装nginx第 ...

  8. 十二、Nodejs 包与 NPM 第三方模块安装 package.json 以及 CNPM

    1. 包 Nodejs 中除了它自己提供的核心模块外,我们可以自定义模块,也可以使用第三方的模块.Nodejs 中第三方模块由包组成,可以通过包来对一组具有相互依赖关系的模块进行统一管理. 在 Nod ...

  9. Nodejs 包与 npm第三方模块安装和 package.json 以及 cnpm

    包与 NPM 1. 包 Nodejs 中除了它自己提供的核心模块外,可以自定义模块,也可以使用第三方的模块.Nodejs 中第三方模块由包组成,可以通过包来对一组具有相互依 赖关系的模块进行统一管理. ...

随机推荐

  1. Android 工程报错解决 Unable to resolve target 'android-17'

    转自:http://www.cnblogs.com/csulennon/p/3705177.html 换了系统后,重新安装了Android SDK和ADT插件,导入之前的工作空间.居然发现所有的And ...

  2. Andorid之Annotation框架初使用(六)

    EVENT @Click :点击事件,只能有0个或1个参数,且参数为View @Click(R.id.myButton) void myButtonWasClicked() { [...] } @Cl ...

  3. ndk 编译 c++ 兼容性问题汇总整理

    转自:http://blog.csdn.net/wenrenwang/article/details/12003671 1.__int64找不到符号 采用int64_t来代替: #if defined ...

  4. MFC中设置对话框/窗体大小固定

    对话框:1.响应WM_GETMINMAXINFO消息(设置lpMMI->ptMinTrackSize和lpMMI->ptMaxTrackSize)2.响应消息WM_SYSCOMMAND,屏 ...

  5. 原生对话框【Dialog】AlertDialog和.Builder

    使用大全 public class MainActivity extends ListActivity );                     pd.setProgress(i);//改变当前进 ...

  6. 130道ASP.NET面试题,我只会80道!

    1. 简述 private. protected. public. internal 修饰符的访问权限.答 . private : 私有成员, 在类的内部才可以访问. protected : 保护成员 ...

  7. Code a simple telnet client using sockets in python

    测试端口是否开放的python脚本 原文: https://www.binarytides.com/code-telnet-client-sockets-python/ 配置: 120.79.14.8 ...

  8. [AngularJS] ng-change vs $scope.$watch

    <div class="form-group"> <label for="pwd">Password</label> < ...

  9. vue - 使用axios

    1. 先安装axios 1.1 npm安装:npm i -D axios 1.2 yarn 安装:yarn add axios --dev 2. 配置main.js,在src目录下. 3. 使用

  10. ant design pro (三)路由和菜单

    一.概述 参看地址:https://pro.ant.design/docs/router-and-nav-cn 二.原文摘要 路由和菜单是组织起一个应用的关键骨架,我们的脚手架提供了一些基本的工具及模 ...