# HG changeset patch # User edogawaconan # Date 1413463290 -32400 # Node ID 9ba6983b7c199aae186e122092495bc439400290 # Parent 8cba59d07798631994a8e696327468ed3db24ea9 Copied readme from blog. diff -r 8cba59d07798 -r 9ba6983b7c19 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Thu Oct 16 21:41:30 2014 +0900 @@ -0,0 +1,29 @@ +Better Autoindex with nginx/php +=============================== + +Using capability of nginx. + +Basically, add this block + + location @lister { + fastcgi_pass unix:/tmp/php-fcgi.sock; + fastcgi_param PREFIX $_list_prefix; + fastcgi_param FILE_ROOT $_list_root; + fastcgi_param SCRIPT_FILENAME /srv/http/index.php; + include fastcgi_params; + } + +(adjust the path to `lister.php` and `php-fcgi`) + +And then whenever you want to autoindex a folder just add + + location /anime/win/ { + set $_list_prefix /anime/win; + set $_list_root /srv/ftp; + alias $_list_root/; + try_files $uri @lister; + } + +And you're done. + +The code needs some cleanups though.