From 3c48fd7c0544652c26b51a6a98e807165a3cd66a Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 23 Mar 2016 17:45:15 +0300 Subject: [PATCH] Stream: detect port absence in proxy_pass with IP literal. This is a clone of http commit 26c127bab5ef. --- src/stream/ngx_stream_upstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream/ngx_stream_upstream.c b/src/stream/ngx_stream_upstream.c index 805ee7029..69dddc5b4 100644 --- a/src/stream/ngx_stream_upstream.c +++ b/src/stream/ngx_stream_upstream.c @@ -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) {