mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
fix fastcgi and memcached upstreams
This commit is contained in:
parent
cf100a7827
commit
5d118d3f77
@ -2010,6 +2010,7 @@ ngx_http_fastcgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
ngx_memzero(&u, sizeof(ngx_url_t));
|
ngx_memzero(&u, sizeof(ngx_url_t));
|
||||||
|
|
||||||
u.url = value[1];
|
u.url = value[1];
|
||||||
|
u.upstream = 1;
|
||||||
u.no_resolve = 1;
|
u.no_resolve = 1;
|
||||||
|
|
||||||
lcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
|
lcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
|
||||||
|
@ -583,6 +583,7 @@ ngx_http_memcached_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
ngx_memzero(&u, sizeof(ngx_url_t));
|
ngx_memzero(&u, sizeof(ngx_url_t));
|
||||||
|
|
||||||
u.url = value[1];
|
u.url = value[1];
|
||||||
|
u.upstream = 1;
|
||||||
u.no_resolve = 1;
|
u.no_resolve = 1;
|
||||||
/* u.uri_part = 1; may be used as namespace */
|
/* u.uri_part = 1; may be used as namespace */
|
||||||
|
|
||||||
|
@ -2159,6 +2159,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
u.url.len = url->len - add;
|
u.url.len = url->len - add;
|
||||||
u.url.data = url->data + add;
|
u.url.data = url->data + add;
|
||||||
u.default_portn = port;
|
u.default_portn = port;
|
||||||
|
u.upstream = 1;
|
||||||
u.no_resolve = 1;
|
u.no_resolve = 1;
|
||||||
u.uri_part = 1;
|
u.uri_part = 1;
|
||||||
|
|
||||||
|
@ -69,13 +69,20 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
|
|||||||
if (ngx_inet_resolve_host(cf, &u) != NGX_OK) {
|
if (ngx_inet_resolve_host(cf, &u) != NGX_OK) {
|
||||||
if (u.err) {
|
if (u.err) {
|
||||||
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
|
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
|
||||||
"%s in upstream host \"%V\" is not found in %s:%ui",
|
"%s in upstream \"%V\" in %s:%ui",
|
||||||
u.err, &us->host, us->file_name.data, us->line);
|
u.err, &us->host, us->file_name.data, us->line);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (us->port == 0) {
|
||||||
|
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
|
||||||
|
"no port in upstream \"%V\" in %s:%ui",
|
||||||
|
&us->host, us->file_name.data, us->line);
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
n = u.naddrs;
|
n = u.naddrs;
|
||||||
|
|
||||||
peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)
|
peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)
|
||||||
|
Loading…
Reference in New Issue
Block a user