From fde7d51392598d0fa74dca125883d9663e7eb80a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 4 Apr 2011 10:43:21 +0000 Subject: fix case when a host in fastcgi_pass, scgi_pass, and uwsgi_pass is given by expression and refers to a defined upstream --- src/http/ngx_http_upstream.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/http/ngx_http_upstream.c') diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index e8d87738f..dc2d0c0fe 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -574,6 +574,14 @@ ngx_http_upstream_init_request(ngx_http_request_t *r) } } + if (u->resolved->port == 0) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "no port in upstream \"%V\"", host); + ngx_http_upstream_finalize_request(r, u, + NGX_HTTP_INTERNAL_SERVER_ERROR); + return; + } + temp.name = *host; ctx = ngx_resolve_start(clcf->resolver, &temp); -- cgit