diff --git a/config b/config index af3a814..4ef3809 100644 --- a/config +++ b/config @@ -1,12 +1,12 @@ # vim:ft=sh: ngx_addon_name=ngx_http_fancyindex_module -if test -n "$ngx_module_link"; then +if [ "$ngx_module_link" = DYNAMIC ] ; then ngx_module_type=HTTP ngx_module_name=ngx_http_fancyindex_module ngx_module_srcs="$ngx_addon_dir/ngx_http_fancyindex_module.c" ngx_module_deps="$ngx_addon_dir/template.h" - + ngx_module_order="$ngx_module_name ngx_http_autoindex_module" . auto/module else # XXX: Insert fancyindex module *after* index module! diff --git a/t/has-index.test b/t/has-index.test new file mode 100644 index 0000000..cf34207 --- /dev/null +++ b/t/has-index.test @@ -0,0 +1,7 @@ +#! /bin/bash +cat <<--- +This test ensures that the "index.html" is returned instead of a directory +listing when fetching a directory which contains an index file. +-- +nginx_start +diff -u "${TESTDIR}/has-index/index.html" <( fetch /has-index/ ) 1>&2 diff --git a/t/has-index/index.html b/t/has-index/index.html new file mode 100644 index 0000000..419ae86 --- /dev/null +++ b/t/has-index/index.html @@ -0,0 +1,10 @@ + + +
+ +index.html
.
+
+