annotate README.md @ 6:8df269a2efd8

Remove unused variable.
author edogawaconan <me@myconan.net>
date Tue, 21 Oct 2014 21:44:36 +0900
parents 9ba6983b7c19
children 47a281c1d54e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 Better Autoindex with nginx/php
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
2 ===============================
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
3
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
4 Using capability of nginx.
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 Basically, add this block
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
7
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
8 location @lister {
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 fastcgi_pass unix:/tmp/php-fcgi.sock;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 fastcgi_param PREFIX $_list_prefix;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
11 fastcgi_param FILE_ROOT $_list_root;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
12 fastcgi_param SCRIPT_FILENAME /srv/http/index.php;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 include fastcgi_params;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
14 }
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
15
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
16 (adjust the path to `lister.php` and `php-fcgi`)
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
17
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 And then whenever you want to autoindex a folder just add
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
19
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
20 location /anime/win/ {
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
21 set $_list_prefix /anime/win;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
22 set $_list_root /srv/ftp;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
23 alias $_list_root/;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
24 try_files $uri @lister;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
25 }
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
26
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
27 And you're done.
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
28
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
29 The code needs some cleanups though.