]> git.kaiwu.me - nginx.git/commitdiff
Stream: detect port absence in proxy_pass with IP literal.
authorRoman Arutyunyan <arut@nginx.com>
Wed, 23 Mar 2016 14:45:15 +0000 (17:45 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Wed, 23 Mar 2016 14:45:15 +0000 (17:45 +0300)
This is a clone of http commit 26c127bab5ef.

src/stream/ngx_stream_upstream.c

index 805ee7029f3a4eb780f12320df79ca5ad237d7fa..69dddc5b4e45eb8a122124cdb41f3756978a570a 100644 (file)
@@ -388,7 +388,7 @@ ngx_stream_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
     uscf->port = u->port;
     uscf->no_port = u->no_port;
 
-    if (u->naddrs == 1) {
+    if (u->naddrs == 1 && (u->port || u->family == AF_UNIX)) {
         uscf->servers = ngx_array_create(cf->pool, 1,
                                          sizeof(ngx_stream_upstream_server_t));
         if (uscf->servers == NULL) {