天天看點

Nginx 開啟目錄浏覽功能配置

在server節點下添加

1 server {
 2     listen       8007;
 3     server_name  default;
 4     #index        index.php;
 5     # 目錄浏覽功能
 6     autoindex on; 
 7     # 顯示檔案大小統計
 8     autoindex_exact_size off;
 9     
10     root         /mnt/hgfs/dev;
11 
12     location ~ \.php(.*)$ {
13         add_header 'Access-Control-Allow-Origin' '*';
14         fastcgi_pass   127.0.0.1:9001;
15         fastcgi_index  index.php;
16         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
17         fastcgi_param PATH_INFO $1;                                                                                                                                                                              
18         include        fastcgi_params;
19     }   
20 }      

轉載于:https://www.cnblogs.com/gouge/p/7089708.html