diff options
| author | Vladimir Homutov <vl@nginx.com> | 2019-10-18 16:33:15 +0300 |
|---|---|---|
| committer | Aleksei Bavshin <a.bavshin@f5.com> | 2024-11-07 07:57:42 -0800 |
| commit | ea4654550ab021b5576c03b708079e3ce3e5d9ed (patch) | |
| tree | 50475aff8a5548657acb8c12a03341356f99364e /src/http/ngx_http_upstream_round_robin.c | |
| parent | 5ebe7a4122c9653ed6b06e6577fc68904ad061c4 (diff) | |
| download | nginx-ea4654550ab021b5576c03b708079e3ce3e5d9ed.tar.gz nginx-ea4654550ab021b5576c03b708079e3ce3e5d9ed.tar.bz2 | |
Upstream: per-upstream resolver.
The "resolver" and "resolver_timeout" directives can now be specified
directly in the "upstream" block.
Diffstat (limited to 'src/http/ngx_http_upstream_round_robin.c')
| -rw-r--r-- | src/http/ngx_http_upstream_round_robin.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c index 5dbd4e626..304494b3c 100644 --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -97,15 +97,15 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - us->resolver = clcf->resolver; - us->resolver_timeout = clcf->resolver_timeout; + if (us->resolver == NULL) { + us->resolver = clcf->resolver; + } /* - * Without "resolver_timeout" in http{}, the value is unset. - * Even if we set it in ngx_http_core_merge_loc_conf(), it's - * still dependent on the module order and unreliable. + * Without "resolver_timeout" in http{} the merged value is unset. */ - ngx_conf_init_msec_value(us->resolver_timeout, 30000); + ngx_conf_merge_msec_value(us->resolver_timeout, + clcf->resolver_timeout, 30000); if (resolve && (us->resolver == NULL |
