Skip to content

Commit ec0578d

Browse files
author
ru
committed
Upstream: warn if multiple non-stackable balancers are installed.
1 parent 2912517 commit ec0578d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/http/modules/ngx_http_upstream_ip_hash_module.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
252252

253253
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
254254

255+
if (uscf->peer.init_upstream) {
256+
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
257+
"load balancing method redefined");
258+
}
259+
255260
uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
256261

257262
uscf->flags = NGX_HTTP_UPSTREAM_CREATE

src/http/modules/ngx_http_upstream_least_conn_module.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,11 @@ ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
387387

388388
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
389389

390+
if (uscf->peer.init_upstream) {
391+
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
392+
"load balancing method redefined");
393+
}
394+
390395
uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
391396

392397
uscf->flags = NGX_HTTP_UPSTREAM_CREATE

0 commit comments

Comments
 (0)