Stream: detect port absence in proxy_pass with IP literal.

This is a clone of http commit 26c127bab5ef.
This commit is contained in:
Roman Arutyunyan 2016-03-23 17:45:15 +03:00
parent f625ad7ce8
commit 3c48fd7c05

View 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->port = u->port;
uscf->no_port = u->no_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, uscf->servers = ngx_array_create(cf->pool, 1,
sizeof(ngx_stream_upstream_server_t)); sizeof(ngx_stream_upstream_server_t));
if (uscf->servers == NULL) { if (uscf->servers == NULL) {