nginx-0.1.3-RELEASE import

    *) Feature: the ngx_http_autoindex_module and the autoindex directive.

    *) Feature: the proxy_set_x_url directive.

    *) Bugfix: proxy module may get caught in an endless loop when sendfile
       is not used.
diff --git a/auto/modules b/auto/modules
index 6c5111a..7d79205 100644
--- a/auto/modules
+++ b/auto/modules
@@ -87,7 +87,15 @@
     HTTP_SRCS="$HTTP_SRCS $HTTP_USERID_SRCS"
 fi
 
-HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE $HTTP_INDEX_MODULE"
+HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE"
+
+if [ $HTTP_AUTOINDEX = YES ]; then
+    have=NGX_HTTP_AUTOINDEX . auto/have
+    HTTP_MODULES="$HTTP_MODULES $HTTP_AUTOINDEX_MODULE"
+    HTTP_SRCS="$HTTP_SRCS $HTTP_AUTOINDEX_SRCS"
+fi
+
+HTTP_MODULES="$HTTP_MODULES $HTTP_INDEX_MODULE"
 
 if [ $HTTP_ACCESS = YES ]; then
     have=NGX_HTTP_ACCESS . auto/have