nginx模块1--索引autoindex_基于ip_监控模块status

egrep -v '#|^$' /etc/nginx/conf.d/default.off > /etc/nginx/conf.d/default.conf

/etc/nginx/conf.d/default.conf  中

目录索引

location /download {     #相对根目录下的download文件夹

root /test;                      #根目录

autoindex on;        #开启目录索引

chareset utf-8,gbk;      #字符编码

autoindex_exact_size off;    #是否显示字节,关闭后根据实际大小显示m/g/t等数据

autoindex_localtime on;     #上传时间显示

}

基于ip访问,监控模块

location /status {     #相对根目录下的download文件夹

stub_status;                   #开启监控

access_log off;        #关闭监控写入日志

deny 10.0.0.1;        #禁止该ip或网段访问

allow all;            #允许所有地址访问

}

监控可以看出长连接区别

server 连接数 accepts 连接成功数 requests请求数

如果长连接超时或者减少 刷新后连接数增加

当使用restart服务连接数清空

而reload保留连接数

原文地址:https://www.cnblogs.com/Leaders543/p/12491233.html