author:咔咔html
wechat:fangkangfknginx
使用/usr/local/nginx/sbin/nginx -V查看nginx自定义安装的模块dom
模块一:--with-http_sub_status_mosule
做用:nginx的客户端状态测试
// 配置语法 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; } }
测试code
模块二: random_index
做用:目录中随机显示一个主页server
配置语法:htm
案例:it
好比说咱们的home/www下面有index1,index2,index3,他会随机的显示这几个文件io
// 配置语法 server { listen 8080; access_log off; server_name localhost; location /{ root /home/www; random_index on; } }
模块三:sub_module
做用:替换http头内容class
语法:
sub_filter是将内容替换
sub_filter_once off 是将http请求里边的全部关于imooc都改成大写