diff README.md @ 1:9ba6983b7c19

Copied readme from blog.
author edogawaconan <me@myconan.net>
date Thu, 16 Oct 2014 21:41:30 +0900
parents
children 47a281c1d54e
line wrap: on
line diff
--- /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.