| Syntax: | include file | mask |
| Default: | |
| Context: | |
| Reference: | include |
You can include any configuration files for what ever purpose you want.
Since 0.4.4, the include directive also supports filename globbing:
include vhosts/*.conf;
Note that until version 0.6.7, paths are relative to what was specified to configure via the --prefix=<PATH> directive, which by default is /usr/local/nginx. If you didn't set this when you compiled Nginx, then use absolute paths.
Since version 0.6.7, paths are relative to directory of nginx configuration file nginx.conf, but not to nginx prefix directory.
Include a document from another source.
file — include a file, e.g. <!--# include file="footer.html" -->
virtual — include a request, e.g. <!--# include virtual="/remote/body.php?argument=value" -->
The target of "file" or "virtual" must be a location in the server configuration.
The distinction between "file" and "virtual" is mostly historical. "file" is the same as "virtual" with implied "wait" option. At one point the directives mirrored the Apache equivalents but now they are basically the same operation. Both can handle a URI and both can serve a static file.
Multiple requests will be issued in parallel. If you need them issued sequentially, use the "wait" option.
stub — The name of the block to use as a default if the request is empty or returns an error. <!--# block name="one" --> <!--# endblock --> <!--# include virtual="/remote/body.php?argument=value" stub="one" -->
wait — when set to yes, the rest of the SSI will not be evaluated until the current request is finished. Example: <!--# include virtual="/remote/body.php?argument=value" wait="yes" -->
set — when set to a variable name, the output of the SSI will not be sent to the output, instead the output is set to the variable. Example: <!--# include virtual="/remote/body.php?argument=value" set="body" -->