[nginx] Proxy: fixed upstream search by proxy_pass with variables.

Ruslan Ermilov ru at nginx.com
Thu Jan 30 15:07:55 UTC 2014


details:   http://hg.nginx.org/nginx/rev/f385349d584b
branches:  
changeset: 5546:f385349d584b
user:      Ruslan Ermilov <ru at nginx.com>
date:      Thu Jan 30 18:57:11 2014 +0400
description:
Proxy: fixed upstream search by proxy_pass with variables.

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.

diffstat:

 src/http/ngx_http_upstream.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 01e2a5bcdd8f -r f385349d584b src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Tue Jan 28 15:33:49 2014 -0800
+++ b/src/http/ngx_http_upstream.c	Thu Jan 30 18:57:11 2014 +0400
@@ -612,7 +612,7 @@ ngx_http_upstream_init_request(ngx_http_
             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;
             }



More information about the nginx-devel mailing list