Use only the new-style module configuration for dynamic builds
For static builds we still need to manually reorder $HTTP_MODULES, and we cannot source "auto/module" like the new-style configuration mode needs, because the "auto/module" snippet modifies $HTTP_MODULES itself, but ignores the new $ngx_module_order variable when doing a static build. Fortunately, the old-style way of configuring the module is still working in all Nginx versions for statically built modules, so we can keep using that for static builds. This fixes issue #46.pull/55/head
parent
3ec11d5d87
commit
5e621202bd
4
config
4
config
|
@ -1,12 +1,12 @@
|
||||||
# vim:ft=sh:
|
# vim:ft=sh:
|
||||||
ngx_addon_name=ngx_http_fancyindex_module
|
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_type=HTTP
|
||||||
ngx_module_name=ngx_http_fancyindex_module
|
ngx_module_name=ngx_http_fancyindex_module
|
||||||
ngx_module_srcs="$ngx_addon_dir/ngx_http_fancyindex_module.c"
|
ngx_module_srcs="$ngx_addon_dir/ngx_http_fancyindex_module.c"
|
||||||
ngx_module_deps="$ngx_addon_dir/template.h"
|
ngx_module_deps="$ngx_addon_dir/template.h"
|
||||||
|
ngx_module_order="$ngx_module_name ngx_http_autoindex_module"
|
||||||
. auto/module
|
. auto/module
|
||||||
else
|
else
|
||||||
# XXX: Insert fancyindex module *after* index module!
|
# XXX: Insert fancyindex module *after* index module!
|
||||||
|
|
|
@ -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
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Index file test</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
This is <code>index.html</code>.
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue