状态监控配置区域有server和location(最常用)
vim /etc/nginx/conf.d/autoindex.html
server{
listen 80;
server_name a1.com;
location / {
root /web/autoindex;
index index.html;
}
location /download{
root /web/autoindex;
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
charset utf-8,gbk;
}
location /nginx_status { #这里必须是nginx_status
stub_status; #开启监控服务,老版本还需要价格on
access_log off; #必须写,表示此页面的访问记录不写入日志文件
}
}
附:restart会清空左右连接数,reload不会