qazxsw1 发表于 2018-11-11 08:16:40

开启nginx状态监控

nginx的ngx_http_stub_status_module提供能够获取Nginx自上次启动以来的工作状态 的功能。如果是编译安装的话,需要–with-http_stub_status_module激活,当然,如果用yum等源安装,则默认已经激活了。  该模块是基于某个server的,所以必须在server里面
  如在http://www.pylong.com/archives/54中的server里面添加
  server{
  listen 80; #监听80端口
  server_name www.pylong.com pylong.com; #绑定域名,多个域名的绑定,用空格分开
  index index.html index.php index.htm;#默认读取的文件名
  root /var/www/html; #绑定的虚拟目录
  location ~ .*.php$ #这个location是把所有关于后缀为php的请求交给php-fastcgi处理
  {
  include /etc/nginx/fastcgi_params;
  fastcgi_pass 127.0.0.1:9000;
  }
  location /nginx_status {
  stub_status on;
  access_log off;
  allow 192.168.1.1;#设置为可访问该状态信息的ip
  deny all;
  }
  }

页: [1]
查看完整版本: 开启nginx状态监控