1、查看配置文件 nginx.conf 路径
nginx -t
服务器nginx目录:
┌── nginx
├── conf.d 模块化配置
├── xxx
├── xxx
└── xxx
├── nginx.conf 根配置
2、打开文件: /nginx/nginx.con 新增以下内容
http {
....
# 模块化配置
include conf.d/*.conf;
....
}
3、新增自定义配置文件夹(conf.d),在nginx目录同级
4、在 conf.d 文件夹 中新增`部署项目`的配置文件( 如:xxxx.conf )
5、在 xxxx.conf 文件中写入项目需要的配置内容
6、重启nginx