Nginx 服务器开启status页面检测服务状态
一、Nginx status monitor
和apache 中服务器状态一样。输出的内容如:

第1列:
- 当前与http建立的连接数,包括等待的客户端连接:2
第2列:
- 接受的客户端连接总数目:20
- 处理的客户端连接总数目:20
- 客户端总的请求数目:50
第3列:
- 当前,nginx读请求连接
- 当前,nginx写响应返回给客户端
- 目前有多少空闲客户端请求连接
二、启用 status 条件
- 检查一下当前nginx的安装配置
[root@elk ~]# nginx -V
nginx version: nginx/1.10.
built by gcc 4.8. (Red Hat 4.8.-) (GCC)
built with OpenSSL 1.0.1e-fips Feb
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules \
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx \
--with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module \
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module \
--with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic \
--add-dynamic-module=njs-1c50334fbea6/nginx --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail \
--with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_v2_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic'如果你的环境中可以看到有 --with-http_sub_module 这个模块,就代表可以启用status 。如果没有,可以在编译时加上。
- 现在编辑nginx 的配置文件。我们新建一个配置文件 /etc/nginx/conf.d/status.conf, 内容如下
[root@elk ~]# cat /etc/nginx/conf.d/status.conf
server {
listen ;
access_log off;
server_name localhost;
root /var/www/html; location /nginx_status {
stub_status on;
access_log off;
allow .xxx.xxx.xxx;
allow 139.59.253.208;
deny all; } }对该页面的访问者进行了过滤,并禁用了访问写入log文件。
- 重启nginx后,在网站后面加上/nginx_status 即可。
http://101.201.238.125:8080/nginx_status
三、nginx plus (企业用户)
官方图:

nginx plus 状态检测图,不过是面对企业用户,需要收费的。而且plus 用户还可以设置nginx 减轻DDOS攻击。具体点击这里
参考文章:
https://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status
https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus/
https://www.nginx.com/products/live-activity-monitoring/
Nginx 服务器开启status页面检测服务状态的更多相关文章
- 全面掌握Nginx配置+快速搭建高可用架构 一 开启status页面检测服务状态
输入命令Nginx -V 打开conf.d/default.conf 配置模块,配置位置在server或者location 配置完成后测试语法正确 nginx -tc /etc/nginx/nginx ...
- Nginx 开启status用以监控状态信息
Nginx 可以通过with-http_stub_status_module模块来监控nginx的一些状态信息.1.通过nginx -V来查看是否有with-http_stub_status_modu ...
- nginx服务器开启缓存、反向代理
一.反向代理配置 1.反向代理服务器配置如下 反向代理就是需要这一行proxy_pass来完成.当我们要访问后端web服务器的时候,我们只需要访问代理服务器就可以了,此时代理服务器就充当后端web服务 ...
- Nginx 之四: Nginx服务器的压缩功能和缓存功能
在Nginx服务器配置文件中可以通过配置Gzip的使用,可以配置在http块,server 块或者location块中设置,Nginx服务器可以通过ngx_http_gzip_module模块.ngx ...
- lunix nginx安装 报错页面 状态码
web服务器软件IIS (windows底下的web服务器软件) Nginx (Linux底下新一代高性能的web服务器) Tengine www.taobao.com 这是淘宝 Apach ...
- nginx服务器状态监控
Nginx开启监控需在编译时加入with-http_stub_status_module,查看当前Nginx编译参数:/usr/local/nginx/sbin/nginx -V 1.以二级目录方式开 ...
- 查看nginx服务器状态
编译安装时使用--with-http_stub_status_module开启状态页面模块 [root@proxy ~]# yum -y install gcc pcre-devel openssl- ...
- 通过浏览器查看nginx服务器状态配置方法
通过浏览器查看nginx服务器状态配置方法 投稿:junjie 字体:[增加 减小] 类型:转载 这篇文章主要介绍了通过浏览器查看nginx服务器状态配置方法,本文讲解开启nginx-status的配 ...
- Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面
Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.status功能概述 status页 ...
随机推荐
- flowable ProcessEngine和ProcessEngineConfiguration
ProcessEngine是流程引擎,ProcessEngineConfiguration与前面四个引擎配置有些不同. ProcessEngineConfiguration增加了邮件服务和httpCl ...
- Kotlin Reference (五) Packages
most from reference 包 源文件可以从包声明开始: package foo.bar fun baz() {} class Goo {} // ... 源文件的所有内容(如类和函数)都 ...
- 开启 Android WebView 的安全浏览模式
Hybrid App(混合式开发)已经是每一个商业应用都会使用的开发手段.其最大的优势就是将一些可动态更新的内容页面使用 H5 开发,然后借用移动端原生系统提供的 WebView 控件加载进来.这种方 ...
- React Native组件(二)View组件解析
相关文章 React Native探索系列 React Native组件系列 前言 了解了RN的组件的生命周期后,我们接着来学习RN的具体的组件.View组件是最基本的组件,也是首先要掌握的组件,这一 ...
- 深度学习(六十七)metal forge深度学习库使用
1.设置输入: let input = Input() 或者 let input = Input(width: 100, height: 100, channels: 3) 2.创建网络: let o ...
- sift特征简述
参考文献:http://blog.csdn.net/abcjennifer/article/details/7639681 分为几个步骤: 1. 构建尺度空间 2. LoG近似DoG找到关键点< ...
- MySQL 5.6.30 升级到5.7.10
MySQL 5.6.30 升级到5.7.10 注意,这种方式的前提是数据文件没有和软件目录在一起,如果在一起,需要停止数据库后先移动数据文件 1.解压5.7.10包到/usr/local2.停止当前的 ...
- iOS内存管理(objective-c)
移动app开发中,由于移动设备内存的限制,内存管理是一个非常重要的话题.objective-c的内存管理,不仅是面试当中老生常谈的一个必问话题,也是日常项目开发中,特别需要重视的环节.对于笔者这种以j ...
- Linux下Eclipse配置安装 PyDev(Pydev插件一直不能成功,安装这个插件失败的问题)
pydev插件安装方式如果采取从网络上下载,然后解压到eclipse中文件夹到方式,运行到时候可能会导致重启eclipse后根本看不到这个插件! 原因以及解决方式,看下面! 转自:http://ww ...
- LG3835 【模板】可持久化平衡树
题意 您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作(对于各个以往的历史版本): 插入x数 删除x数(若有多个相同的数,因只删除一个,如果没有请忽略该操作) 查询x数的排名 ...