nginx使用include命令拆分配置文件

include

1
2
3
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.

1
2
include mime.types;
include vhosts/*.conf; #通配符写法

注:适用范围是任何地方,include命令相当于是复制文件内容到引用的地方