首页 / NGINX / nginx信息功能启用
nginx信息功能启用
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nginx信息功能启用,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2863字,纯文字阅读大概需要5分钟。
内容图文
--with-http_stub_status_module 这个模块功能是记录nginx基本信息访问状态1、检查编译是否有这个功能模块。
[root@slave nginx]# /usr/sbin/nginx -V
nginx version: nginx/1.8.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --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/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre
[root@slave nginx]#
2、在目录下添加server段
##status
server {
listen 80;
server_name status.wolf.com;
location / {
stub_status on;
access_log off;
}
}
3、添加hosts
[root@slave nginx]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.203 www.wolf.com bbs.wolf.com blog.wolf.com wolf.com status.wolf.com
笔记本添加
[root@slave nginx]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.203 www.wolf.com bbs.wolf.com blog.wolf.com wolf.com status.wolf.com
4、语法检查
[root@slave nginx]# /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
5、重启服务
[root@slave nginx]# /usr/sbin/nginx -s reload
6、测试
浏览器http://status.wolf.com/访问
Active connections: 5
server accepts handled requests
54 54 408
Reading: 0 Writing: 1 Waiting: 4
[root@slave nginx]# curl status.wolf.com
Active connections: 6
server accepts handled requests
55 55 414
Reading: 0 Writing: 1 Waiting: 5
7、访问限制
##status
server {
listen 80;
server_name status.wolf.com;
location / {
stub_status on;
access_log off;
allow 192.168.0.0/24;
deny all;
}
}
8、访问log说明
active connections – 活跃的连接数量
server accepts handled requests — 总共处理了11989个连接 , 成功创建11989次握手, 总共处理了11991个请求
reading — 读取客户端的连接数.
writing — 响应数据到客户端的数量
waiting — 开启 keep-alive 的情况下,这个值等于 active – (reading+writing), 意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接.
以上就介绍了 nginx信息功能启用,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
内容总结
以上是互联网集市为您收集整理的nginx信息功能启用全部内容,希望文章能够帮你解决nginx信息功能启用所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。