annotate README.md @ 10:47a281c1d54e

Update documentation to match current code.
author edogawaconan <me@myconan.net>
date Tue, 21 Oct 2014 22:07:03 +0900
parents 9ba6983b7c19
children 37fad414ac29
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 {
10
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
9 include fastcgi_params;
1
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 fastcgi_pass unix:/tmp/php-fcgi.sock;
10
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
11 uninitialized_variable_warn off;
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
12 fastcgi_param DL_PREFIX $dl_root;
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
13 fastcgi_param DL_ROOT $dl_prefix;
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
14 fastcgi_param SCRIPT_FILENAME /path/to/index.php;
1
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
10
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
17 (adjust the path to `index.php` and `php-fcgi`)
1
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
18
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
19 And then whenever you want to autoindex a folder just add
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
20
10
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
21 location / {
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
22 try_files $uri @lister;
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
23 }
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
24
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
25 Note that if your directory is aliased, you need to set `$dl_prefix` (fastcgi `DL_PREFIX`) and `$dl_root` (fastcgi `DL_ROOT`).
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
26
1
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
27 location /anime/win/ {
10
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
28 set $dl_prefix /anime/win;
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
29 set $dl_root /srv/ftp;
47a281c1d54e Update documentation to match current code.
edogawaconan <me@myconan.net>
parents: 1
diff changeset
30 alias $dl_root/;
1
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
31 try_files $uri @lister;
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
32 }
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
33
9ba6983b7c19 Copied readme from blog.
edogawaconan <me@myconan.net>
parents:
diff changeset
34 And you're done.