diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2011-04-04 10:43:21 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2011-04-04 10:43:21 +0000 |
| commit | fde7d51392598d0fa74dca125883d9663e7eb80a (patch) | |
| tree | fbde480f7a1eddb2091efcf5543624e89c04ace6 /src/http/ngx_http_upstream.c | |
| parent | 450c981ab968c073049aea7f16dad0134701a403 (diff) | |
| download | nginx-fde7d51392598d0fa74dca125883d9663e7eb80a.tar.gz nginx-fde7d51392598d0fa74dca125883d9663e7eb80a.tar.bz2 | |
fix case when a host in fastcgi_pass, scgi_pass, and uwsgi_pass
is given by expression and refers to a defined upstream
Diffstat (limited to 'src/http/ngx_http_upstream.c')
| -rw-r--r-- | src/http/ngx_http_upstream.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |
