mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 02:42:48 +08:00
Upstream: warn if multiple non-stackable balancers are installed.
This commit is contained in:
parent
c798029241
commit
7ea00fb58c
@ -252,6 +252,11 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
|
|
||||||
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
|
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
|
||||||
|
|
||||||
|
if (uscf->peer.init_upstream) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||||
|
"load balancing method redefined");
|
||||||
|
}
|
||||||
|
|
||||||
uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
|
uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
|
||||||
|
|
||||||
uscf->flags = NGX_HTTP_UPSTREAM_CREATE
|
uscf->flags = NGX_HTTP_UPSTREAM_CREATE
|
||||||
|
@ -387,6 +387,11 @@ ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
|
|
||||||
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
|
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
|
||||||
|
|
||||||
|
if (uscf->peer.init_upstream) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||||
|
"load balancing method redefined");
|
||||||
|
}
|
||||||
|
|
||||||
uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
|
uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
|
||||||
|
|
||||||
uscf->flags = NGX_HTTP_UPSTREAM_CREATE
|
uscf->flags = NGX_HTTP_UPSTREAM_CREATE
|
||||||
|
Loading…
Reference in New Issue
Block a user