comparison README.md @ 23:949398173ecb

Much simpler setup with $request_filename. Configuration change, bump version.
author edogawaconan <me@myconan.net>
date Thu, 23 Oct 2014 21:47:51 +0900
parents b6b65a5b9c1a
children f9588ccb7a42
comparison
equal deleted inserted replaced
22:431682ff9169 23:949398173ecb
7 7
8 location @lister { 8 location @lister {
9 include fastcgi_params; 9 include fastcgi_params;
10 fastcgi_pass unix:/tmp/php-fcgi.sock; 10 fastcgi_pass unix:/tmp/php-fcgi.sock;
11 uninitialized_variable_warn off; 11 uninitialized_variable_warn off;
12 fastcgi_param DL_PREFIX $dl_root; 12 fastcgi_param DL_DIR $dl_dir;
13 fastcgi_param DL_ROOT $dl_prefix;
14 fastcgi_param SCRIPT_FILENAME /path/to/index.php; 13 fastcgi_param SCRIPT_FILENAME /path/to/index.php;
15 } 14 }
16 15
17 (adjust the path to `index.php` and `php-fcgi`) 16 (adjust the path to `index.php` and `php-fcgi`).
18 17
19 And then whenever you want to autoindex a folder just add 18 And whenever a directory needs to be autoindexed, add
20 19
21 location / { 20 location / {
22 try_files $uri @lister; 21 try_files $uri @lister;
23 } 22 }
24 23
25 Note that if your directory is aliased, you need to set `$dl_prefix` (fastcgi `DL_PREFIX`) and `$dl_root` (fastcgi `DL_ROOT`). 24 .
25
26 Note that if the directory is aliased, `$dl_dir` (fastcgi `DL_DIR`) needs to be set.
26 27
27 location /anime/win/ { 28 location /anime/win/ {
28 set $dl_prefix /anime/win; 29 set $dl_dir $request_filename;
29 set $dl_root /srv/ftp; 30 alias /srv/ftp/;
30 alias $dl_root/; 31 try_files $uri @lister; // try_files "" @lister if the alias is
31 try_files $uri @lister;
32 } 32 }
33 33
34 And you're done. Probably also works with apache but I have no idea how to setup it. 34 And done. Probably also works with apache but I have no idea how to set it up.
35
36 Upgrading
37 ---------
38
39 When upgrading from 1.0.0, update nginx config accordingly.
35 40
36 License 41 License
37 ------- 42 -------
38 43
39 Copyright 2014 edogawaconan <me@myconan.net> 44 Copyright 2014 edogawaconan <me@myconan.net>