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都改成大寫