How to use variables after nginx include statement
迷茫
迷茫 2017-05-16 17:20:46
0
2
629

like

include $document_root/aaa.txt;

An error will be reported
open() "/etc/nginx/$document_root/aaa.txt" failed (2: No such file or directory) in /etc/nginx/nginx.conf:xxx

The variables after include are not parsed

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
Peter_Zhu

There were no variables when including it. Variables only appeared very later.

PHPzhong

http://nginx.org/en/docs/ngx_core_module.html#include

Syntax: include file | mask;
Default: —
Context: any
Includes another file, or files matching the specified mask, into configuration. Included files should consist of syntactically correct directives and blocks.

Usage example:

include mime.types;
include vhosts/*.conf;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!