Opened 7 years ago
Closed 7 years ago
#1524 closed defect (worksforme)
Nginx accept config with unknown directive
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | major | Milestone: | |
Component: | nginx-core | Version: | 1.12.x |
Keywords: | Cc: | ||
uname -a: | Linux lb-02 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux | ||
nginx -V: | nginx/1.12.2 |
Description
root@lb-02:/etc/nginx# cat nginx.conf | grep include && nginx -t include /etc/nginx/mime.types; not_include /etc/nginx/conf.d/*.conf; nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
Package from official nginx repository:
root@lb-02:/etc/nginx# cat /etc/apt/sources.list.d/nginx.list deb https://nginx.org/packages/debian/ stretch nginx
On other server all OK:
root@web-06:/etc/nginx# nginx -v && uname -a && cat /etc/apt/sources.list.d/nginx.list nginx version: nginx/1.12.2 Linux web-06 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux deb https://nginx.org/packages/debian/ stretch nginx root@web-06:/etc/nginx# cat nginx.conf | grep include && nginx -t include /etc/nginx/mime.types; not_include /etc/nginx/conf.d/*.conf; nginx: [emerg] unknown directive "not_include" in /etc/nginx/nginx.conf:31 nginx: configuration file /etc/nginx/nginx.conf test failed
Attachments (1)
Change History (4)
by , 7 years ago
Attachment: | lb-02-dpkg.log added |
---|
comment:1 by , 7 years ago
Did you make any changes to /etc/nginx/mime.types on lb-02? Could you please share that file?
comment:2 by , 7 years ago
In nginx configuration, directives are not required to start and end with new lines. As such, the provided information is not enough to conclude that not_include ...
in the grep provided is interpreted as a directive. For example, in the following configuration it will be interpreted as an index file name:
index index.html not_include /etc/nginx/conf.d/*.conf;
Note no ;
after the first line, so both not_include
and /etc/nginx/conf.d/*.conf
are interpreted as parameters of the index
directive.
If you think there is indeed a bug, and not a misconfiguration as explained above, please provide full nginx -T
output.
List of installed packages