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 }

 

posted @ 2017-06-28 14:53  L狗哥  阅读(818)  评论(0编辑  收藏  举报