1.1 企业规范优化Nginx配置文件
第一个里程碑:创建扩展目录,生成虚拟主机配置文件
mkdir extra
sed -n '10,15p' nginx.conf >extra/www.conf
sed -n '16,21p' nginx.conf >extra/bbs.conf
sed -n '22,27p' nginx.conf >extra/blog.conf
第二个里程碑:修改nginx主配置文件,加载相应虚拟主机配置文件
[root@web01 conf]# cat nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
include extra/www.conf;
include extra/bbs.conf;
include extra/blog.conf;
}
第三里程碑:重启服务,进行检验测试