# HG changeset patch # User edogawaconan # Date 1413896823 -32400 # Node ID 47a281c1d54eac3644f56cf12722fdc6acf23a1b # Parent 5db51091e2912fbc6004592c316e944b51680099 Update documentation to match current code. diff -r 5db51091e291 -r 47a281c1d54e README.md --- a/README.md Tue Oct 21 21:50:20 2014 +0900 +++ b/README.md Tue Oct 21 22:07:03 2014 +0900 @@ -6,24 +6,29 @@ Basically, add this block location @lister { + include fastcgi_params; 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; + uninitialized_variable_warn off; + fastcgi_param DL_PREFIX $dl_root; + fastcgi_param DL_ROOT $dl_prefix; + fastcgi_param SCRIPT_FILENAME /path/to/index.php; } -(adjust the path to `lister.php` and `php-fcgi`) +(adjust the path to `index.php` and `php-fcgi`) And then whenever you want to autoindex a folder just add + location / { + try_files $uri @lister; + } + +Note that if your directory is aliased, you need to set `$dl_prefix` (fastcgi `DL_PREFIX`) and `$dl_root` (fastcgi `DL_ROOT`). + location /anime/win/ { - set $_list_prefix /anime/win; - set $_list_root /srv/ftp; - alias $_list_root/; + set $dl_prefix /anime/win; + set $dl_root /srv/ftp; + alias $dl_root/; try_files $uri @lister; } And you're done. - -The code needs some cleanups though.