view README.md @ 14:c2a468e9f3ac

Add lightbox support \o/
author edogawaconan <me@myconan.net>
date Wed, 22 Oct 2014 01:12:55 +0900
parents b6b65a5b9c1a
children 949398173ecb
line wrap: on
line source

dirlist
=======

Using capability of nginx.

Basically, add this block

    location @lister {
      include fastcgi_params;
      fastcgi_pass unix:/tmp/php-fcgi.sock;
      uninitialized_variable_warn off;
      fastcgi_param DL_PREFIX $dl_root;
      fastcgi_param DL_ROOT $dl_prefix;
      fastcgi_param SCRIPT_FILENAME /path/to/index.php;
    }

(adjust the path to `index.php` and `php-fcgi`)

And then whenever you want to autoindex a folder just add

    location / {
      try_files $uri @lister;
    }

Note that if your directory is aliased, you need to set `$dl_prefix` (fastcgi `DL_PREFIX`) and `$dl_root` (fastcgi `DL_ROOT`).

    location /anime/win/ {
      set $dl_prefix /anime/win;
      set $dl_root /srv/ftp;
      alias $dl_root/;
      try_files $uri @lister;
    }

And you're done. Probably also works with apache but I have no idea how to setup it.

License
-------

    Copyright 2014 edogawaconan <me@myconan.net>

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted, provided that the above
    copyright notice and this permission notice appear in all copies.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.