Klaus Demo nginx / 89f82c1
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
5 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
13351335 return NGX_CONF_OK;
13361336 }
13371337
1338 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
1338 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
13391339 "invalid value \"%s\"", value[1].data);
13401340
13411341 return NGX_CONF_ERROR;
13771377 }
13781378
13791379 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,
13811381 "invalid value \"%s\"", value[i].data);
13821382
13831383 return NGX_CONF_ERROR;
36553655 engine = ENGINE_by_id((char *) value[1].data);
36563656
36573657 if (engine == NULL) {
3658 ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
3658 ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
36593659 "ENGINE_by_id(\"%V\") failed", &value[1]);
36603660 return NGX_CONF_ERROR;
36613661 }
36623662
36633663 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,
36653665 "ENGINE_set_default(\"%V\", ENGINE_METHOD_ALL) failed",
36663666 &value[1]);
36673667
57165716 }
57175717
57185718 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,
57205720 "upstream \"%V\" may not have port %d",
57215721 &u->host, u->port);
57225722 return NULL;
57235723 }
57245724
57255725 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,
57275727 "upstream \"%V\" may not have port %d in %s:%ui",
57285728 &u->host, uscfp[i]->port,
57295729 uscfp[i]->file_name, uscfp[i]->line);
487487 }
488488
489489 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,
491491 "\"starttls\" directive conflicts with \"ssl on\"");
492492 return NGX_CONF_ERROR;
493493 }
513513 }
514514
515515 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,
517517 "\"ssl\" directive conflicts with \"starttls\"");
518518 return NGX_CONF_ERROR;
519519 }
585585 }
586586
587587 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,
589589 "upstream \"%V\" may not have port %d",
590590 &u->host, u->port);
591591 return NULL;
592592 }
593593
594594 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,
596596 "upstream \"%V\" may not have port %d in %s:%ui",
597597 &u->host, uscfp[i]->port,
598598 uscfp[i]->file_name, uscfp[i]->line);