Home  >  Article  >  Operation and Maintenance  >  How to create multiple configuration files in nginx

How to create multiple configuration files in nginx

王林
王林forward
2020-12-18 10:16:196225browse

How to create multiple configuration files in nginx

First of all, we need to make it clear that nginx can create multiple configuration files. If an nginx can only create one configuration file, it would be a waste of resources.

(Learning video sharing: Programming video)

The specific method is as follows:

First add a line of code to the main configuration file

vi /usr/local/nginx/conf/nginx.conf

include conf.d/*.conf; #将这行代码写在http模块中

Note: Do not write the wrong location, otherwise the configuration will not take effect

The name of the configuration file must be written *.conf For example: download.conf web.conf

How to create multiple configuration files in nginx

##Then restart nginx to take effect

nginx -t
nginx -s reload

Related recommendations:

nginx tutorial

The above is the detailed content of How to create multiple configuration files in nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete