ngx_strlow()
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index b975c06..e310bbb 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1120,9 +1120,7 @@
                     ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
 
                 } else {
-                    for (i = 0; i < h->key.len; i++) {
-                        h->lowcase_key[i] = ngx_tolower(h->key.data[i]);
-                    }
+                    ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
                 }
 
                 hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 8a7f2ab..880d998 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1196,7 +1196,6 @@
 ngx_http_proxy_process_header(ngx_http_request_t *r)
 {
     ngx_int_t                       rc;
-    ngx_uint_t                      i;
     ngx_table_elt_t                *h;
     ngx_http_upstream_header_t     *hh;
     ngx_http_upstream_main_conf_t  *umcf;
@@ -1237,9 +1236,7 @@
                 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
 
             } else {
-                for (i = 0; i < h->key.len; i++) {
-                    h->lowcase_key[i] = ngx_tolower(h->key.data[i]);
-                }
+                ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
             }
 
             hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
diff --git a/src/http/modules/ngx_http_sub_filter_module.c b/src/http/modules/ngx_http_sub_filter_module.c
index e45ca6e..62a8f08 100644
--- a/src/http/modules/ngx_http_sub_filter_module.c
+++ b/src/http/modules/ngx_http_sub_filter_module.c
@@ -632,7 +632,6 @@
 
     ngx_str_t                  *value;
     ngx_int_t                   n;
-    ngx_uint_t                  i;
     ngx_http_script_compile_t   sc;
 
     if (slcf->match.len) {
@@ -641,11 +640,9 @@
 
     value = cf->args->elts;
 
-    slcf->match = value[1];
+    ngx_strlow(value[1].data, value[1].data, value[1].len);
 
-    for (i = 0; i < value[1].len; i++) {
-        value[1].data[i] = ngx_tolower(value[1].data[i]);
-    }
+    slcf->match = value[1];
 
     n = ngx_http_script_variables_count(&value[2]);
 
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index ed4dacd..757ae17 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1259,7 +1259,7 @@
 ngx_http_add_names(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
     ngx_http_conf_in_addr_t *in_addr)
 {
-    ngx_uint_t               i, n;
+    ngx_uint_t               i;
     ngx_http_server_name_t  *server_names, *name;
 
     if (in_addr->names.elts == NULL) {
@@ -1275,10 +1275,8 @@
 
     for (i = 0; i < cscf->server_names.nelts; i++) {
 
-        for (n = 0; n < server_names[i].name.len; n++) {
-            server_names[i].name.data[n] =
-                                     ngx_tolower(server_names[i].name.data[n]);
-        }
+        ngx_strlow(server_names[i].name.data, server_names[i].name.data,
+                   server_names[i].name.len);
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, cf->log, 0,
                        "name: %V", &server_names[i].name);
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 9aad1a4..ec36f50 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -818,7 +818,6 @@
     ssize_t                     n;
     ngx_int_t                   rc, rv;
     ngx_str_t                   header;
-    ngx_uint_t                  i;
     ngx_table_elt_t            *h;
     ngx_connection_t           *c;
     ngx_http_header_t          *hh;
@@ -928,9 +927,7 @@
                 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
 
             } else {
-                for (i = 0; i < h->key.len; i++) {
-                    h->lowcase_key[i] = ngx_tolower(h->key.data[i]);
-                }
+                ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
             }
 
             hh = ngx_hash_find(&cmcf->headers_in_hash, h->hash,
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
index e014170..b415722 100644
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -277,9 +277,7 @@
         return NULL;
     }
 
-    for (i = 0; i < name->len; i++) {
-        v->name.data[i] = ngx_tolower(name->data[i]);
-    }
+    ngx_strlow(v->name.data, name->data, name->len);
 
     v->set_handler = NULL;
     v->get_handler = NULL;
@@ -344,9 +342,7 @@
         return NGX_ERROR;
     }
 
-    for (i = 0; i < name->len; i++) {
-        v->name.data[i] = ngx_tolower(name->data[i]);
-    }
+    ngx_strlow(v->name.data, name->data, name->len);
 
     v->set_handler = NULL;
     v->get_handler = NULL;