Mercurial > dirlist-php
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 |
rev | line source |
---|---|
1 | 1 Better Autoindex with nginx/php |
2 =============================== | |
3 | |
4 Using capability of nginx. | |
5 | |
6 Basically, add this block | |
7 | |
8 location @lister { | |
10
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
9 include fastcgi_params; |
1 | 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 | 15 } |
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 | 18 |
19 And then whenever you want to autoindex a folder just add | |
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 | 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 | 31 try_files $uri @lister; |
32 } | |
33 | |
34 And you're done. |