]> git.kaiwu.me - nginx.git/commitdiff
Proxy: fixed upstream search by proxy_pass with variables.
authorRuslan Ermilov <ru@nginx.com>
Thu, 30 Jan 2014 14:57:11 +0000 (18:57 +0400)
committerRuslan Ermilov <ru@nginx.com>
Thu, 30 Jan 2014 14:57:11 +0000 (18:57 +0400)
If "proxy_pass" is specified with variables, the resulting
hostname is looked up in the list of upstreams defined in
configuration.  The search was case-sensitive, as opposed
to the case of "proxy_pass" specified without variables.

src/http/ngx_http_upstream.c

index 0524144f22b9b33da65445b0181178aed77e5734..26b57644144c95c8e955e9fd237944281da8c38e 100644 (file)
@@ -612,7 +612,7 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
             if (uscf->host.len == host->len
                 && ((uscf->port == 0 && u->resolved->no_port)
                      || uscf->port == u->resolved->port)
-                && ngx_memcmp(uscf->host.data, host->data, host->len) == 0)
+                && ngx_strncasecmp(uscf->host.data, host->data, host->len) == 0)
             {
                 goto found;
             }