annotate README.md @ 12:37fad414ac29

Add license.
author edogawaconan <me@myconan.net>
date Wed, 22 Oct 2014 00:07:25 +0900
parents 47a281c1d54e
children b6b65a5b9c1a
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.
12
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
35
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
36 License
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
37 -------
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
38
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
39 Copyright 2014 edogawaconan <me@myconan.net>
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
40
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
41 Permission to use, copy, modify, and/or distribute this software for any
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
42 purpose with or without fee is hereby granted, provided that the above
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
43 copyright notice and this permission notice appear in all copies.
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
44
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
45 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
46 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
47 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
48 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
49 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
50 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
37fad414ac29 Add license.
edogawaconan <me@myconan.net>
parents: 10
diff changeset
51 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.