原文:http://www.cnblogs.com/hanyifeng/p/5830013.html

一、Nginx status monitor

  和apache 中服务器状态一样。输出的内容如:

  

    第1列:

  • 当前与http建立的连接数,包括等待的客户端连接:2

    第2列:

  • 接受的客户端连接总数目:20
  • 处理的客户端连接总数目:20
  • 客户端总的请求数目:50

    第3列:

  • 当前,nginx读请求连接
  • 当前,nginx写响应返回给客户端
  • 目前有多少空闲客户端请求连接

二、启用 status 条件

1.检查一下当前nginx的安装配置

[root@elk ~]# nginx -V
nginx version: nginx/1.10.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
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'

  1. 如果你的环境中可以看到有 --with-http_sub_module 这个模块,就代表可以启用status 。如果没有,可以在编译时加上。

  2. 现在编辑nginx 的配置文件。我们新建一个配置文件 /etc/nginx/conf.d/status.conf, 内容如下
    [root@elk ~]# cat /etc/nginx/conf.d/status.conf
    server {listen 8080;access_log off;server_name localhost;root /var/www/html;location /nginx_status {stub_status on;access_log off;allow 223.xxx.xxx.xxx;allow 139.59.253.208;deny all;}}

对该页面的访问者进行了过滤,并禁用了访问写入log文件。

3.重启nginx后,在网站后面加上/nginx_status 即可。

http://101.201.238.125:8080/nginx_status

Nginx 服务器开启status页面检测服务状态相关推荐

  1. Linux 下Nginx开启status用以监控状态信息

    目录 1.通过nginx -V来查看是否有with-http_stub_status_module该模块 2.启用nginx status配置 3.重启nginx 4.打开status页面

  2. php fpm 开启status,启用php-fpm状态详解

    转自链接:https://my.oschina.net/766/blog/265451 摘要: php-fpm和nginx一样内建了一个状态页,对于想了解php-fpm的状态以及监控php-fpm非常 ...

  3. nginx服务器开启缓存、反向代理

    一.反向代理配置 1.反向代理服务器配置如下 反向代理就是需要这一行proxy_pass来完成.当我们要访问后端web服务器的时候,我们只需要访问代理服务器就可以了,此时代理服务器就充当后端web服务 ...

  4. php页面会返回状态200,服务器404错误页面http状态返回值为200的原因解析

    今天在网上找了很多关于404页面的相关资料,目的就是为了吃透关于404的一些知识. 登陆google管理工具后台,发现网站未验证,并提示:我们检测到您的 404(找不到文件)错误页在标头中返回了 20 ...

  5. Nginx服务器开启gzip压缩功能额必要性

    2019独角兽企业重金招聘Python工程师标准>>> 一般情况下压缩后的html.css.js.php.jhtml等文件,大小能降至原来的25%,也就是说,原本一个100k的htm ...

  6. linux nginx服务器开启wss协议

    1.先在linux找出nginx可执行文件的路径 命令行输入: ps -ef | grep nginx 返回 [root@localhost /data/nginx/logs 09:47:00& ...

  7. Nginx服务器的压缩功能和缓存功能

    介绍 在Nginx服务器配置文件中可以通过配置Gzip的使用,可以配置在http块,server 块或者location块中设置,Nginx服务器可以通过ngx_http_gzip_module模块. ...

  8. ECS搭建nginx服务器在阿里云

    需要搭建自己的服务器除了使用本地PC外,我们还可以使用阿里.腾讯.新浪等平台提供的云服务器. 本文主要记录在阿里云上运行Ubuntu系统搭建nginx服务器的过程. 使用阿里云搭建nginx服务器总体 ...

  9. 查看nginx服务器状态

    如何查看服务器状态信息(非常重要的功能) 1)编译安装时使用--with-http_stub_status_module开启状态页面模块 # nginx -s stop # cd # rm -rf / ...

最新文章

  1. 34种墨西哥植物模型 Globe Plants – Bundle 34 Mexican Plants
  2. 2018.11.06-知识回顾
  3. hc05与单片机连接图_单片机科普:单片机的IO口不够用了怎么办?如何扩展单片机的IO口...
  4. 30个非常有吸引力的黑色网站设计作品
  5. AsyncTask使用详解
  6. python url拼接_详解Python urlencode编码和url拼接方法
  7. Mock数据,语法规范
  8. 在Eclipse中使用CVS的实践建议
  9. python 执行shell_python中执行shell的两种方法总结
  10. 线程通信:生产者消费者问题
  11. 深度学习TF—14.WGAN原理及实战
  12. python画围棋棋盘_Python语言程序设计之二--用turtle库画围棋棋盘和正、余弦函数图形...
  13. 7月1日天刀服务器维护,天涯明月刀7月1日满级新服_天刀满级新服天命风流入君怀_3DM网游...
  14. 泰拉瑞亚服务器怎么让玩家注册,泰拉瑞亚服务器权限指令大全
  15. 第八届ACM趣味编程循环赛重现赛(部分题目)
  16. python学习(五)--打印错误信息
  17. 顶点计划1——信通2018级学生上早自习缺勤率情况分析
  18. DGV中复选框第一列可编辑 ,第一列固定显示
  19. c语言修仙键盘,最后一口气ulbsans电脑版
  20. 实验:ospf与BFD联动实验(EVE模拟器-Cisco)

热门文章

  1. 触摸屏之linux3.4.2安装tslib
  2. JS学习记录(BOM部分)
  3. IrregularGridCollectionView处理不定宽度的标签cell
  4. LightOj 1078 Basic Math
  5. python 多进程 调用模块内函数_python子进程模块subprocess详解与应用实例 之一
  6. ubuntu20 编译dpdk错误 -Werror=address-of-packed-member
  7. matlab strfind用法,findstr和strfind区别
  8. 查看是否打印GC收集细节
  9. IntelliJ IDEA中无法加载jar包导致出现“cannot resolve symbol...”问题的解决
  10. 2020/5/13号单词