#_autoindex for Nginx
介绍:自定义目录浏览页面,无需安装插件
安装:将_autoindex目录复制到网站(或虚拟目录)的根目录。
注意:需要配置php支持, 留意下面星号(**)之间的配置
修改nginx.conf
####主目录 配置方法:
location / { index index.html index.htm index.php **/_autoindex/index.php**; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
####虚拟目录 配置方法:
location ~ ^/sync/.+\.php$ { **alias /Users/jackchan/Sync/;** **rewrite /sync/(.*\.php?) /$1 break;** fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME **/Users/jackchan/Sync**$fastcgi_script_name; include fastcgi_params; } location /sync { **alias /Users/jackchan/Sync/;** index index.html index.htm index.php **/sync/_autoindex/index.php**; }
####更多: fulicat.com