nginx 文件二级目录配置
yum install nginx -y
grep -Ev "#|^$" /etc/nginx/nginx.conf.default >
/etc/nginx/nginx.conf
cat /etc/nginx/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# 加入二级配置文件目录
include conf.d/*.conf;
}
总结:在主配置文件nginx.conf的http{}中加入
include conf.d/*.conf;
表示在同级目录下conf.d目录下所有以.conf结尾的配置文件