Skip to content

Commit 1875201

Browse files
zengjinjidenji
authored andcommitted
fix: only worker proccess can exec health check
when upstream server increases and nginx add proxy_cache command, 512 worker_connections are not enough may occur in error log. because helper process only have 512 connection
1 parent 3fe63ef commit 1875201

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ngx_http_upstream_check_module.c

+4
Original file line numberDiff line numberDiff line change
@@ -4470,6 +4470,10 @@ static ngx_int_t
44704470
ngx_http_upstream_check_init_process(ngx_cycle_t *cycle) {
44714471
ngx_http_upstream_check_main_conf_t *ucmcf;
44724472

4473+
if (ngx_process != NGX_PROCESS_WORKER) {
4474+
return NGX_OK;
4475+
}
4476+
44734477
ucmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_upstream_check_module);
44744478
if (ucmcf == NULL) {
44754479
return NGX_OK;

0 commit comments

Comments
 (0)