remove r->root_length
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
index 1c77093..f5944c4 100644
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -135,7 +135,7 @@
 {
     u_char                         *last, *filename, scale;
     off_t                           length;
-    size_t                          len, copy, allocated;
+    size_t                          len, copy, allocated, root;
     ngx_tm_t                        tm;
     ngx_err_t                       err;
     ngx_buf_t                      *b;
@@ -174,7 +174,8 @@
 
     /* NGX_DIR_MASK_LEN is lesser than NGX_HTTP_AUTOINDEX_PREALLOCATE */
 
-    last = ngx_http_map_uri_to_path(r, &path, NGX_HTTP_AUTOINDEX_PREALLOCATE);
+    last = ngx_http_map_uri_to_path(r, &path, &root,
+                                    NGX_HTTP_AUTOINDEX_PREALLOCATE);
     if (last == NULL) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index 02dd388..81c1dc4 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -102,6 +102,7 @@
 ngx_http_dav_handler(ngx_http_request_t *r)
 {
     char                     *failed;
+    size_t                    root;
     ngx_int_t                 rc;
     ngx_str_t                 path;
     ngx_file_info_t           fi;
@@ -152,7 +153,7 @@
             return rc;
         }
 
-        ngx_http_map_uri_to_path(r, &path, 0);
+        ngx_http_map_uri_to_path(r, &path, &root, 0);
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "http delete filename: \"%s\"", path.data);
@@ -219,7 +220,7 @@
             return rc;
         }
 
-        ngx_http_map_uri_to_path(r, &path, 0);
+        ngx_http_map_uri_to_path(r, &path, &root, 0);
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "http mkcol path: \"%s\"", path.data);
@@ -245,6 +246,7 @@
 {
     char                     *failed;
     u_char                   *name;
+    size_t                    root;
     time_t                    date;
     ngx_err_t                 err;
     ngx_str_t                *temp, path;
@@ -252,7 +254,7 @@
     ngx_file_info_t           fi;
     ngx_http_dav_loc_conf_t  *dlcf;
 
-    ngx_http_map_uri_to_path(r, &path, 0);
+    ngx_http_map_uri_to_path(r, &path, &root, 0);
 
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                    "http put filename: \"%s\"", path.data);
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index cd1c51e..3af8026 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -28,6 +28,8 @@
     ngx_str_t                path;
     ngx_str_t                index;
 
+    size_t                   root;
+
     ngx_uint_t               tested;     /* unsigned  tested:1 */
 } ngx_http_index_ctx_t;
 
@@ -200,7 +202,7 @@
 
         if (len > (size_t) (ctx->path.data + ctx->path.len - ctx->index.data)) {
 
-            last = ngx_http_map_uri_to_path(r, &ctx->path, len);
+            last = ngx_http_map_uri_to_path(r, &ctx->path, &ctx->root, len);
             if (last == NULL) {
                 return NGX_ERROR;
             }
@@ -291,7 +293,7 @@
         uri.len = r->uri.len + ctx->index.len - 1;
 
         if (!clcf->alias) {
-            uri.data = ctx->path.data + r->root_length;
+            uri.data = ctx->path.data + ctx->root;
 
         } else {
             uri.data = ngx_palloc(r->pool, uri.len);
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index f9df46e..bc150bf 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -73,6 +73,7 @@
 ngx_http_static_handler(ngx_http_request_t *r)
 {
     u_char                    *last, *location;
+    size_t                     root;
     ngx_fd_t                   fd;
     ngx_int_t                  rc;
     ngx_uint_t                 level;
@@ -112,7 +113,7 @@
      * so we do not need to reserve memory for '/' for possible redirect
      */
 
-    last = ngx_http_map_uri_to_path(r, &path, 0);
+    last = ngx_http_map_uri_to_path(r, &path, &root, 0);
     if (last == NULL) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }