Fixed log levels of configuration parsing errors.
All the errors that prevent loading configuration must be printed on the "emerg"
log level. Previously, nginx might silently fail to load configuration in some
cases as the default log level is "error".
Valentin Bartenev
5 years ago
1335 | 1335 |
return NGX_CONF_OK;
|
1336 | 1336 |
}
|
1337 | 1337 |
|
1338 | |
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
1338 |
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1339 | 1339 |
"invalid value \"%s\"", value[1].data);
|
1340 | 1340 |
|
1341 | 1341 |
return NGX_CONF_ERROR;
|
|
1377 | 1377 |
}
|
1378 | 1378 |
|
1379 | 1379 |
if (mask[m].name.len == 0) {
|
1380 | |
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
1380 |
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1381 | 1381 |
"invalid value \"%s\"", value[i].data);
|
1382 | 1382 |
|
1383 | 1383 |
return NGX_CONF_ERROR;
|
3655 | 3655 |
engine = ENGINE_by_id((char *) value[1].data);
|
3656 | 3656 |
|
3657 | 3657 |
if (engine == NULL) {
|
3658 | |
ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
|
|
3658 |
ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
|
3659 | 3659 |
"ENGINE_by_id(\"%V\") failed", &value[1]);
|
3660 | 3660 |
return NGX_CONF_ERROR;
|
3661 | 3661 |
}
|
3662 | 3662 |
|
3663 | 3663 |
if (ENGINE_set_default(engine, ENGINE_METHOD_ALL) == 0) {
|
3664 | |
ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
|
|
3664 |
ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
|
3665 | 3665 |
"ENGINE_set_default(\"%V\", ENGINE_METHOD_ALL) failed",
|
3666 | 3666 |
&value[1]);
|
3667 | 3667 |
|
5716 | 5716 |
}
|
5717 | 5717 |
|
5718 | 5718 |
if ((uscfp[i]->flags & NGX_HTTP_UPSTREAM_CREATE) && !u->no_port) {
|
5719 | |
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
5719 |
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
5720 | 5720 |
"upstream \"%V\" may not have port %d",
|
5721 | 5721 |
&u->host, u->port);
|
5722 | 5722 |
return NULL;
|
5723 | 5723 |
}
|
5724 | 5724 |
|
5725 | 5725 |
if ((flags & NGX_HTTP_UPSTREAM_CREATE) && !uscfp[i]->no_port) {
|
5726 | |
ngx_log_error(NGX_LOG_WARN, cf->log, 0,
|
|
5726 |
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
|
5727 | 5727 |
"upstream \"%V\" may not have port %d in %s:%ui",
|
5728 | 5728 |
&u->host, uscfp[i]->port,
|
5729 | 5729 |
uscfp[i]->file_name, uscfp[i]->line);
|
487 | 487 |
}
|
488 | 488 |
|
489 | 489 |
if (scf->enable && (ngx_int_t) scf->starttls > NGX_MAIL_STARTTLS_OFF) {
|
490 | |
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
490 |
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
491 | 491 |
"\"starttls\" directive conflicts with \"ssl on\"");
|
492 | 492 |
return NGX_CONF_ERROR;
|
493 | 493 |
}
|
|
513 | 513 |
}
|
514 | 514 |
|
515 | 515 |
if (scf->enable == 1 && (ngx_int_t) scf->starttls > NGX_MAIL_STARTTLS_OFF) {
|
516 | |
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
516 |
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
517 | 517 |
"\"ssl\" directive conflicts with \"starttls\"");
|
518 | 518 |
return NGX_CONF_ERROR;
|
519 | 519 |
}
|
585 | 585 |
}
|
586 | 586 |
|
587 | 587 |
if ((uscfp[i]->flags & NGX_STREAM_UPSTREAM_CREATE) && !u->no_port) {
|
588 | |
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
588 |
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
589 | 589 |
"upstream \"%V\" may not have port %d",
|
590 | 590 |
&u->host, u->port);
|
591 | 591 |
return NULL;
|
592 | 592 |
}
|
593 | 593 |
|
594 | 594 |
if ((flags & NGX_STREAM_UPSTREAM_CREATE) && !uscfp[i]->no_port) {
|
595 | |
ngx_log_error(NGX_LOG_WARN, cf->log, 0,
|
|
595 |
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
|
596 | 596 |
"upstream \"%V\" may not have port %d in %s:%ui",
|
597 | 597 |
&u->host, uscfp[i]->port,
|
598 | 598 |
uscfp[i]->file_name, uscfp[i]->line);
|