return NGX_ERROR;
}
- if (url.no_port) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no port in upstream \"%V\"", &url.url);
- return NGX_ERROR;
- }
-
u = r->upstream;
u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
} else {
u->resolved->host = url.host;
u->resolved->port = url.port;
+ u->resolved->no_port = url.no_port;
}
return NGX_OK;
return NGX_ERROR;
}
- if (url.no_port) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no port in upstream \"%V\"", &url.url);
- return NGX_ERROR;
- }
-
u = r->upstream;
u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
} else {
u->resolved->host = url.host;
u->resolved->port = url.port;
+ u->resolved->no_port = url.no_port;
}
return NGX_OK;
return NGX_ERROR;
}
- if (url.no_port) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no port in upstream \"%V\"", &url.url);
- return NGX_ERROR;
- }
-
u = r->upstream;
u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
} else {
u->resolved->host = url.host;
u->resolved->port = url.port;
+ u->resolved->no_port = url.no_port;
}
return NGX_OK;
}
}
+ 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);