Welcome! Log In Create A New Profile

Advanced

Re: nginx-1.6.2 Ошибочный синтаксис в конфигурации

Валентин Бартенев
October 08, 2014 04:46AM
On Wednesday 08 October 2014 04:35:23 vvmluxsite wrote:
> server (
> ...
> index index.html
> include include.conf;
> ....
> }
>
> Результат:
>
> Performing sanity check on nginx configuration:
> nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /usr/local/etc/nginx/nginx.conf test is
> successful

Ничего удивительного. Вы пропустили точку с запятой
в результате чего "include" и "include.conf" были
интерпретированы как значения директивы index.

С точки зрения синтаксиса директивы index значения
валидны.

>
>
> Вместо индекса другая директива, например:
> server (
> ...
> error_log /var/log/nginx/error_qqq.log
> include include.conf;
> ....
> }
> даёт такой результат:
>
> Performing sanity check on nginx configuration:
> nginx: [emerg] invalid log level "include" in
> /usr/local/etc/nginx/vhosts/sites-enabled/sites.conf:15
>

В директиве error_log вторым параметром, если задан,
должен задаваться уровень логгирования, который
может принимать только одно из следующих значений:
debug, info, notice, warn, error, crit, alert и emerg.

Значение "include" не является корректным уровнем
логгирования.

См. документацию:
http://nginx.org/r/error_log/ru



>
> Теперь error_log после индекса:
> server (
> ...
> index index.html
> error_log /var/log/nginx/error_qqq.log
> include include.conf;
> ....
> }
> Получается:
>
> Performing sanity check on nginx configuration:
> nginx: [warn] only the last index in "index" directive should be absolute in
> /usr/local/etc/nginx/vhosts/sites-enabled/sites.conf:15
> nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /usr/local/etc/nginx/nginx.conf test is
> successful

Опять же, из-за пропущенных точек запятой все это
интерпретируется как значения директивы index, а именно
пять значений:

1. index.html
2. error_log
3. /var/log/nginx/error_qqq.log
4. include
5. include.conf



>
>
> Просто "f":
> server (
> ...
> index index.html
> # error_log /var/log/srv_www/nginx/error_qqq.log
> f
> include include.conf;
> ....
> }
> Такой результат:
>
> Performing sanity check on nginx configuration:
> nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /usr/local/etc/nginx/nginx.conf test is
> successful
>
> Если включить "error_log" из последнего примера:
> Performing sanity check on nginx configuration:
> nginx: [warn] only the last index in "index" directive should be absolute in
> /usr/local/etc/nginx/vhosts/sites-enabled/sites.conf:16
> nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /usr/local/etc/nginx/nginx.conf test is
> successful
>
> Тут 16-я строка: include include.conf;
>

Аналогично. Будьте внимательны.

--
Валентин Бартенев
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx-1.6.2 Ошибочный синтаксис в конфигурации

vvmluxsite October 08, 2014 04:35AM

Re: nginx-1.6.2 Ошибочный синтаксис в конфигурации

Sergey Kandaurov October 08, 2014 04:44AM

Re: nginx-1.6.2 Ошибочный синтаксис в конфигурации

Dmitriy Lyalyuev October 08, 2014 04:44AM

Re: nginx-1.6.2 Ошибочный синтаксис в конфигурации

Валентин Бартенев October 08, 2014 04:46AM

Re: nginx-1.6.2 Ошибочный синтаксис в конфигурации

vvmluxsite October 08, 2014 04:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready