Using capability of nginx.
Basically, add this block
location @lister { fastcgi_pass unix:/tmp/php-fcgi.sock; fastcgi_param PREFIX $_list_prefix; fastcgi_param FILE_ROOT $_list_root; fastcgi_param SCRIPT_FILENAME /srv/http/lister.php; include fastcgi_params; }
(adjust the path to lister.php and php-fcgi)
And then whenever you want to autoindex a folder just add
location /anime/win/ { set $_list_prefix /anime/win; set $_list_root /srv/ftp; alias $_list_root/; try_files $uri @lister; }
And you’re done.
The code still needs some cleanups though.
[ lister.php ]
clean your code… 😐
that’s what you get when creating something in work hours.
k I pwnd thx
nice idea btw,
but still that’s just _too much_ hacking just to do some file listing…
I wonder…
still better than my previous attempt of directly hacking ngx_http_autoindex_module.c :> (which then discovered a bug in the module, hurr)